I am trying to build a container from a docker image that seems to be incompatible with M1 macs, it does work with my old laptop which is Intel architecture, after research I'm pretty sure ARM architecture is the issue. When I add the platform linux/amd64 flag for my docker-compose it builds successfully, but I am not sure how platform works. For instance, what happens if I'm building on a Windows machine or some other OS?
The platform option is not currently supported on docker-compose v3: https://github.com/docker/compose/pull/5985
Related
As we know already, there are several platforms available to run on docker.
On Mac OS though, docker is based on a hypervisor called Hyperkit, so I guess we use a virtual machine.
I was wondering if there are any difference between linux/amd64 and linux/arm64/v8one when running on a mac silicon.
Plus: what if we generate a linux/amd64 image on a mac m1? is the amd64 environment emulated by qemu? so: would there be qemu on top of the hypervisor? just the hypervisor?
It don't run the same since it is not the same platform, docker need to utilize emulation/Virtualization.
You should make it a default to run arm64 images on apple silicon but, if it's neccesary/mandatory you can run amd64 with docker desktop for m1
just use flag:
docker run --platform linux/amd64
docker run doc
About your other question Docker removed the requirment for Rosetta 2 for the installation process but, they still state that it is needed for some CLI tools such as "using Darwin/AMD64", based on that i think it is safe to assume that the emulation/virtualization "tool" is Rosetta 2 :)
Apple silicon (M1) System requirements
What is this warning:
I have enabled docker compose V2 and set export DOCKER_DEFAULT_PLATFORM=linux/amd64 as an env variable as I believe that this enables an emulation that allows the docker images to run on an Apple M1 chip.
I am new to docker and am wondering if this means that the emulation is working or if I have not configured something correctly?
The warning means that amd64 images have poor performance, and sometimes crashing behavior as well. This is a known issue with Docker + qemu on the Apple Silicon chips. For this reason, Docker recommends avoiding use of amd64 images when possible.
https://docs.docker.com/desktop/mac/apple-silicon/
Not all images are available for ARM64 architecture. You can add --platform linux/amd64 to run an Intel image under emulation. In particular, the mysql image is not available for ARM64. You can work around this issue by using a mariadb image.
However, attempts to run Intel-based containers on Apple silicon machines under emulation can crash as qemu sometimes fails to run the container. In addition, filesystem change notification APIs (inotify) do not work under qemu emulation. Even when the containers do run correctly under emulation, they will be slower and use more memory than the native equivalent.
In summary, running Intel-based containers on Arm-based machines should be regarded as “best effort” only. We recommend running arm64 containers on Apple silicon machines whenever possible, and encouraging container authors to produce arm64, or multi-arch, versions of their containers. We expect this issue to become less common over time, as more and more images are rebuilt supporting multiple architectures.
When installing Docker Desktop for Apple Silicon, the official instructions says:
You must install Rosetta 2 as some binaries are still Darwin/AMD64.
However, if I understand correctly, Intel-based containers actually use QEMU for emulation rather than Rosetta:
However, attempts to run Intel-based containers on Apple Silicon machines under emulation can crash as qemu sometimes fails to run the container.
(This is one of the reasons why Docker is slow when running non-native containers on M1.)
So what does Docker actually use Rosetta for?
I have a native application which is compiled on IBM AIX 7.1 Operating System using XL C/C++ compiler. Is it possible to run the application using docker which is installed on Linux machine? I tried to find the base image for IBM AIX OS, but was unsuccessful.
No. You could use qemu to emulate a powerpc processor but there is no full AIX emulation to run usermode programs. It would also run rather more slowly.
I have tried to download latest docker and it
Docker Desktop requires Windows 10 Pro or Enterprise version 14393 to run.
My build is :
It is difficult to find Docker which supports my version and on Google searches i am just finding posts where people are getting same error with 10586 build which suggests that Docker window exists for this build.
Can anyone suggest how to find and install the same?
From Docker Developer:
We updated the doc. Sorry, effectively we stopped supporting build
10586 in september, you will need to update to windows build 14393 at
least to install Docker For Windows. (Alternatively you can use Docker
Toolbox on windows)