Dockerfile for Darling
Go to file
CuriousTommy 9f4230cd59
Merge pull request #3 from pellaeon/pr-deb-dependency
Add package dependencies from the latest deb
2022-11-11 06:56:11 -08:00
bootstrap Initial version 2020-04-13 00:12:51 +02:00
build_daily.py Switch over to GitHub packages as Docker Registry 2020-04-19 13:08:17 +02:00
darling-dkms_1.0_all.deb Initial version 2020-04-13 00:12:51 +02:00
Dockerfile Add package dependencies from the latest deb 2021-05-17 16:02:57 +08:00
README.md Switch over to GitHub packages as Docker Registry 2020-04-19 13:08:17 +02:00
shell Initial version 2020-04-13 00:12:51 +02:00

Darling in Docker

This is the source code of the Darling Docker image. This is an experimental feature!

Running desktop software under Docker has inherent challenges. It is up to you to ensure that the container can connect to X11, D-Bus (-> PulseAudio) etc.

Prerequisites

You still need to build and install Darling's Linux kernel module within the host system.

BEWARE: The darling-dkms package inside this repository is fake.

Before starting the container, do as root:

modprobe darling-mach

Tutorial

Starting a container:

docker run -d --name darling1 docker.pkg.github.com/darlinghq/darling/darling:latest

Now you have a container named darling1 with launchd and various daemons running. You can drop into a shell:

docker exec -ti darling1 shell

You can run various commands:

docker exec darling1 shell -c 'uname -a'

Advanced

Experimental X11

First of all, disable authorization on your X11 session by executing xhost +. Keeping the authorization enabled is trickier.

docker run -d --name darling1 -e DISPLAY \
    -v /tmp/.X11-unix:/tmp/.X11-unix -v /run/dbus:/run/dbus \
    -v docker.pkg.github.com/darlinghq/darling/darling:latest

Whether this works or not depends mainly on the compatibility of OpenGL runtimes between the container and the host.

Technical Notes

Darling uses a virtual chroot environment under /usr/libexec/darling:

  • If you bind a volume as /somewhere, it will be accessible as /Volumes/SystemRoot/somewhere.
  • If you bind a volume as /usr/libexec/darling/somewhere, it will appear as /somewhere.

The base system of the image is Ubuntu. Therefore, if you do this, you will drop into a Linux shell, and NOT into the macOS shell:

docker exec -ti darling1 /bin/bash

macOS Bash lives as /usr/libexec/darling/bin/bash. The shell command used in above examples is just a convenience shortcut.