I am using docker in Version 1.12.0 (build 10871) on Mac OS (El Capitan 10.11.4) and I want to provide a config file for the docker daemon.
Under Ubuntu you place the config under /etc/default/docker
(see docs). Unfortunately, I cannot figure out where to place the config in Mac OS
Any ideas?
I am using Docker for Mac 1.13.0 on MacOS 10.12 and the daemon settings can be accessed via the Docker app (Preferences -> Daemon -> Advanced).
But if you change this to something wrong, you will render your installation unusable (the daemon will no longer start-up). This happened to me.
I found out that the settings are stored in a Git repository in
~/Library/Containers/com.docker.docker/Data/database
where I had to issue agit reset --hard HEAD
before I could change anything. After that the daemon settings are available in~/Library/Containers/com.docker.docker/Data/database/com.docker.driver.amd64-linux/etc/docker/daemon.json
.Edit, commit and restart the Docker app … et voilà … the daemon starts again.
My docker versin is as follow:
On my OSX 10.13.2, the path of daemon.json is
/var/config/docker/daemon.json
in the VM. You can use this command to attach a screen session to VM's tty:In the VM, you can grep
dockerd
process to get config file path:Docker EE/CE 17+
Docker for Mac/Windows has added a config editor to the tray icon UI to allow editing of Dockers
daemon.json
file that will be persisted in the VM.To access it go to the Docker Icon > Preferences > Daemon > Advanced
Original Answer
The Docker for Mac VM is based on Alpine Linux. The init system is based on OpenRC.
You can attach a screen session to the VM's tty (terminal) and poke around
The docker daemon config is in the usual spot
The
/etc/init.d/docker
script that manages the startup does not seem very configurable, apart from editing the script./host_docker_app
in the VM is a mount of the data in~/Library/Containers/com.docker.docker/Data/
from OSX. This seems like the most likely place to persist custom config but it doesn't look like there is any interface to source/load config or anything at startup from there.It looks like changes outside of
/var
or/host_docker_app
will not persist over reboots. There was a mechanism to persist some startup config in the old boot2docker VM image but I haven't found anything like it for the new VM.