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?
On recent versions of Docker Desktop for Mac, the files are in ~/. docker.
The preferred method for configuring the Docker Engine on Windows is using a configuration file. The configuration file can be found at 'C:\ProgramData\Docker\config\daemon. json'. You can create this file if it doesn't already exist.
In Windows containers, configs are all mounted into C:\ProgramData\Docker\configs and symbolic links are created to the desired location, which defaults to C:\<config-name> . You can set the ownership ( uid and gid ) for the config, using either the numerical ID or the name of the user or group.
On MacOS go to the whale in the taskbar > Preferences > Daemon > Advanced. Here’s what the configuration file looks like: With this configuration the Docker daemon runs in debug mode, uses TLS, and listens for traffic routed to 192.168.59.3 on port 2376 .
The docker0 bridge can be configured with docker args, it will take effect after reboot. In your cloud-config, System Docker configuration is located under the rancher.system_docker key. #cloud-config rancher: system_docker: storage_driver: overlay All daemon arguments shown in the first table are also available to System Docker.
The Docker daemon log can be viewed by using one of the following methods: /var/log/messages, /var/log/daemon.log, or /var/log/docker.log on older Linux systems Note: It is not possible to manually generate a stack trace on Docker Desktop for Mac or Docker Desktop for Windows.
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 ).
Config file is now available in ~/.docker/daemon.json
(see Ed's Answer)
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
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
$ screen ~/Library/Containers/com.docker.docker/Data/com.docker.driver.amd64-linux/tty
The docker daemon config is in the usual spot
moby:/etc/docker# ls -l /etc/docker/ total 8 -rw-r--r-- 1 root root 38 Aug 5 11:26 daemon.json -rw------- 1 root root 244 Aug 5 11:26 key.json
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.
On recent versions of Docker Desktop for Mac, the files are in ~/.docker.
~/.docker/daemon.json
Custom (ie. self-signed) certificates can be copied into
~/.docker/certs.d/{MyRegistry:port}/client.crt
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With