Is it possible to get macOS running in a Docker container?
I know that it's possible to get macOS running in a VM under Parallels, VirtualBox and VMWare Fusion. I have containers with Windows and many distributions of Linux and BSD Unix. I'm hoping somebody has managed to get macOS running in a container.
Yes you can run macOS in a Docker Container: https://github.com/sickcodes/Docker-OSX
It has very low overheads because it's all real KVM nested virtualization.
I have stress tested it and the minimum requirements is about 2.5GB of RAM per container. The Docker container is Arch but it has very low overheads.
Make your own container:
# Catalina
docker run -it \
--device /dev/kvm \
-p 50922:10022 \
-v /tmp/.X11-unix:/tmp/.X11-unix \
-e "DISPLAY=${DISPLAY:-:0.0}" \
sickcodes/docker-osx:latest
# Big Sur
docker run -it \
--device /dev/kvm \
-p 50922:10022 \
-v /tmp/.X11-unix:/tmp/.X11-unix \
-e "DISPLAY=${DISPLAY:-:0.0}" \
sickcodes/docker-osx:big-sur
Or if you want to fast-track, or use CLI only, you can boot straight into a real headless MacOS command line using :auto
docker run -it \
--device /dev/kvm \
sickcodes/docker-osx:auto
You'll drop into the Darwin shell.
Extra options:
Visual display:
-e "DISPLAY=${DISPLAY:-:0.0}" \
-v /tmp/.X11-unix:/tmp/.X11-unix \
Add SSH:
-p 50922:10022 \
Change resolution
-e GENERATE_UNIQUE=true \
-e WIDTH=800 \
-e HEIGHT=600 \
This looks promising! I will try to get it to work.
https://github.com/Cleafy/sxkdvm