Last active
September 30, 2025 16:37
-
-
Save afbjorklund/90868919eae14320f0a71a8baf929f97 to your computer and use it in GitHub Desktop.
apple container with docker
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| FROM ubuntu | |
| RUN apt-get update && apt-get install -y --no-install-recommends ca-certificates curl && rm -rf /var/lib/apt/lists/* | |
| RUN curl -fsSL https://get.docker.com | sh | |
| RUN apt-get update && apt-get install -y --no-install-recommends procps && rm -rf /var/lib/apt/lists/* | |
| RUN ( echo "net.ipv6.conf.all.disable_ipv6=1"; echo "net.ipv6.conf.default.disable_ipv6=1" ) | tee /etc/sysctl.d/container.conf | |
| RUN apt-get update && apt-get install -y --no-install-recommends iptables && rm -rf /var/lib/apt/lists/* | |
| RUN update-alternatives --set iptables /usr/sbin/iptables-legacy && update-alternatives --set ip6tables /usr/sbin/ip6tables-legacy | |
| RUN apt-get update && apt-get install -y --no-install-recommends systemd && rm -rf /var/lib/apt/lists/* | |
| ENTRYPOINT ["/lib/systemd/systemd"] | |
| # https://systemd.io/CONTAINER_INTERFACE/ | |
| STOPSIGNAL SIGRTMIN+3 |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Now Apple Container supports systemd, and we can run the regular Ubuntu LTS and Docker Engine
Previous workaround: https://gist.github.com/afbjorklund/99ec0683c82f03e58c22b0d2753b9f50
build container image with buildkit
container build -t ubuntu-docker .start container VM in the background
container=$(container run -d ubuntu-docker)open a shell in the running container
container exec -it $container bashdocker version