mirror of
https://github.com/sickcodes/Docker-OSX.git
synced 2026-01-13 13:53:28 +01:00
How to get docker-osx running on mac silicon (arm64)? #407
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @alanwilter on GitHub (Oct 11, 2022).
All I saw here was about running on Linux or Windows.
My idea was to have a simple macOS image with homebrew to build macOS related apps in a contained environment: Dockerfile with
FROM ... (which image?)andRUN brew install..., using my own Mac (silicon) as a host.@WJacobsNL commented on GitHub (Oct 12, 2022):
Here for the same reason :) Curious about the solution
@callmewoem commented on GitHub (Oct 12, 2022):
what
@danielgroen commented on GitHub (Oct 18, 2022):
Same here!
I think the
--deviceflag should not beKVMsince this KVM is not made for macOS. But i guess there should be a other build system available then KVM but then for Mac@PATAPOsha commented on GitHub (Oct 19, 2022):
Use
buildxfor building docker image.E.g.:
docker buildx build -t my-image --platform=linux/amd64 --progress=plain --build-arg DISPLAY=$DISPLAY .Then run container like so:
docker run -it --platform linux/amd64 --net=host --name mi-container my-image.I tried Dockerfile starting with
FROM sickcodes/docker-osx:monterey. It created and launched successfully.However, I stuck on installing
homebrewinto container. Can not get how to addhomebrewto the PATH.There is no
~/.zprofileor~/.zshrco r~/.profileinside image...UPDATE
It is
~/.guestfish.RUN echo 'eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"' >> ~/.guestfishto add brew to the PATH.@alanwilter commented on GitHub (Oct 19, 2022):
Well, that did not quite work for me. Is your hosting Mac an M1/2 (silicon chip)?
When I run your instructions I got:
But if I do:
I got the prompt. However,
lscpuis not auspicious:I'm not surprised to
linux, what I'm surprised is to seex86_64.In the end, I'm hoping to see a
darwinandarm64, like when I douname -ain my host Mac (silicon).I did try:
So I'm back to square one, is there such image? Or, is there a way to build it?
@PATAPOsha commented on GitHub (Oct 24, 2022):
Yes, I'm using MacBook Pro m1 pro
From what I seen these "Docker-OSX" are based on linux
x86_64image. So no, there is no cleanarmmacOs image. Correct me if I am wrong.@patniemeyer commented on GitHub (Dec 3, 2022):
This definitely seems like it should be possible since UTM is just a GUI for running QEMU and it runs on M1 ARM. (https://mac.getutm.app/).
EDIT: I was wrong, UTM on MacOS uses the Apple virtualization not QEMU.
@ylluminate commented on GitHub (Dec 4, 2022):
@patniemeyer you can use QEMU actually with UTM to run pre-Apple Virtualization supported guest virtual machines. For example, Mojave and High Sierra can and should be run this way. We definitely need to see macOS support here since there are still essential usecases for older OS releases, especially Mojave.
@ylluminate commented on GitHub (Jun 23, 2023):
Has anything happened on this front?
@AhirGhosh commented on GitHub (Jul 16, 2023):
Hello all, any workable solution in this front please? Running on Apple M1 and getting this :
Status: Downloaded newer image for sickcodes/docker-osx:monterey **WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested** docker: Error response from daemon: error gathering device information while adding custom device "/dev/kvm": no such file or directory.@Destrocamil commented on GitHub (Oct 8, 2024):
@AhirGhosh read the thread
@lyzhang1999 commented on GitHub (May 24, 2025):
mark