arm (note, not arm64) emulation seems to tickle a bug in QEMU, this is with the latest version of docker desktop:
cat > Dockerfile <<eof
FROM balenalib/rpi-raspbian:bullseye-20210925
USER root
RUN apt-get update -y && apt-get upgrade -y
eof
docker build .
leads to the following error:
[2/2] RUN apt-get update -y && apt-get upgrade -y:
#6 1.018 Get:1 Index of /debian bullseye InRelease [23.5 kB]
#6 1.018 qemu: uncaught target signal 4 (Illegal instruction) - core dumped
#6 1.075 Reading package lists…
#6 1.193 E: Method http has died unexpectedly!
#6 1.194 E: Sub-process http received signal 4.
rimelek
(Ákos Takács)
December 18, 2021, 8:15pm
2
It seems you are not alone with this:
opened 04:31AM - 08 Jan 21 UTC
closed 10:57AM - 24 Feb 21 UTC
lifecycle/locked
area/m1
<!--
Please, check https://docs.docker.com/docker-for-mac/troubleshoot/.
Issue… s without a clear description, logs and details cannot be debugged, and will be closed.
Please give your issue a clear title, not just a one-word statement or a diagnostics ID.
Issues unrelated to Docker Desktop will be closed. In particular, see
- https://github.com/docker/compose/issues for docker-compose
- https://github.com/docker/machine/issues for docker-machine
- https://github.com/moby/moby/issues for Docker daemon
- https://github.com/docker/docker.github.io/issues for the documentation
-->
### Issue:
I tried to run the 'apache/airflow' image (https://hub.docker.com/r/apache/airflow) with docker-compose.
The container is able to start, but after running some airflow commends, the container is terminated with an error 'qemu: uncaught target signal 4 (Illegal instruction) - core dumped'
### Actual behavior
Following is my docker-compose.yml file
```
version: '3.8'
services:
webserver:
image: apache/airflow
command: bash -c
"airflow db init
&& airflow users create -u admin -f Peter -l Parker -r Admin -e spiderman@superhero.org -p ****
&& airflow webserver"
volumes:
- ./dags:/opt/airflow/dags
environment:
- AIRFLOW__CORE__SQL_ALCHEMY_CONN=mysql+mysqldb://airflow:airflow@192.168.64.1:3306/airflow
- AIRFLOW__CORE__EXECUTOR=LocalExecutor
ports:
- "8080:8080"
```
After I run "docker-compose up", I get:
```
Recreating docker-airflow_webserver_1 ... done
Attaching to docker-airflow_webserver_1
webserver_1 | DB_BACKEND=mysql+mysqldb
webserver_1 | DB_HOST=192.168.64.1
webserver_1 | DB_PORT=3306
webserver_1 |
webserver_1 | DB: mysql+mysqldb://airflow:***@192.168.64.1:3306/airflow
webserver_1 | [2021-01-08 04:28:45,451] {db.py:678} INFO - Creating tables
webserver_1 | INFO [alembic.runtime.migration] Context impl MySQLImpl.
webserver_1 | INFO [alembic.runtime.migration] Will assume non-transactional DDL.
webserver_1 | qemu: uncaught target signal 4 (Illegal instruction) - core dumped
webserver_1 | /bin/bash: line 1: 21 Illegal instruction airflow db init
docker-airflow_webserver_1 exited with code 132
```
### Information
<!--
Please, help us understand the problem. For instance:
- Is it reproducible?
- Is the problem new?
- Did the problem appear with an update?
- A reproducible case if this is a bug, Dockerfiles FTW.
-->
- macOS Version: Big Sur
- Docker for Mac: Apple silicon preview version released on Dec 16
<!--
A reproducible case, Dockerfiles FTW.
-->
Do I have to wait for the production version of Docker Desktop for Mac? How can I fix it? Thanks!
They say what you suspected that it is a qemu bug.
There is also a bug report in balenalib github repository:
opened 09:48AM - 21 Apr 21 UTC
**Steps to reproduce:**
On a Apple Silicon machine:
1. Create a Dockerfile… that contains the following:
```
FROM balenalib/rpi-raspbian
RUN apt-get update -y
```
2. Build it:
```docker build .```
**Expected**: No errors
**Actual**: Fails due to
```#5 2.888 W: GPG error: http://archive.raspberrypi.org/debian buster InRelease: Unknown error executing apt-key
#5 2.888 E: The repository 'http://archive.raspberrypi.org/debian buster InRelease' is not signed.
#5 2.888 W: GPG error: http://archive.raspbian.org/raspbian buster InRelease: Unknown error executing apt-key
#5 2.888 E: The repository 'http://archive.raspbian.org/raspbian buster InRelease' is not signed.
------
executor failed running [/bin/sh -c apt-get update -y]: exit code: 100
```
**Configurations**:
`balenalib/raspberry-pi` on Intel WORKS
`balenalib/raspberry-pi` on Apple Silicon FAILS
`balenalib/raspberrypi3` on Apple Silicon WORKS
On Apple Silicon, latest Big Sur and Docker are used:
```% docker -v
Docker version 20.10.5, build 55c4c88
% sw_vers
ProductName: macOS
ProductVersion: 11.2.3
BuildVersion: 20D91
```
Additional debugging:
```
% docker run -ti --platform linux/arm/v6 balenalib/rpi-raspbian:latest
root@627909b18b76:/# apt-get update -y
Get:1 http://archive.raspberrypi.org/debian buster InRelease [32.9 kB]
Get:2 http://archive.raspbian.org/raspbian buster InRelease [15.0 kB]
Err:1 http://archive.raspberrypi.org/debian buster InRelease
Unknown error executing apt-key
Err:2 http://archive.raspbian.org/raspbian buster InRelease
Unknown error executing apt-key
Reading package lists... Done
W: GPG error: http://archive.raspberrypi.org/debian buster InRelease: Unknown error executing apt-key
E: The repository 'http://archive.raspberrypi.org/debian buster InRelease' is not signed.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
W: GPG error: http://archive.raspbian.org/raspbian buster InRelease: Unknown error executing apt-key
E: The repository 'http://archive.raspbian.org/raspbian buster InRelease' is not signed.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
root@627909b18b76:/# apt-key exportall
qemu: uncaught target signal 4 (Illegal instruction) - core dumped
Illegal instruction
```
The error message is different but I suspect the reason is the same. If you try to run the “buster” version you will get the other error message referring to “apt-key”.
At the end of the issue you can find a link to the balena forum:
I don’t know balena so I don’t really understand what they say there but it might help you.