After updating my OpenSUSE docker host to last version, 1.12.6, I can't have docker daemon both listening do socket and IP.
If I include
"hosts": ["tcp://192.168.1.1:2376"]
in my daemon.json, it binds correctly to that IP and I can connect to docker from my intranet, but it won't open local socket so I can execute docker commands locally. If I remove that hosts entry, local docker commands work (default configuration) but obviously I can't access the host from the Intranet.
Adding fd:// to hosts JSON array won't work. I get an error message when restarting docker service stating that there are no sockets available.
My question is: What is the configuration to include in daemon.json "hosts" entry to add not only tcp hosts but also socket?
To configure the Docker daemon using a JSON file, create a file at /etc/docker/daemon.json on Linux systems, or C:\ProgramData\docker\config\daemon.json on Windows. On MacOS go to the whale in the taskbar > Preferences > Daemon > Advanced. You can also start the Docker daemon manually and configure it using flags.
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'.
sock is basically the Unix socket the Docker daemon listens on by default. It is also a tool used to communicate with the Docker daemon from within a container. Sometimes, containers need to bind mount the /var/run/docker. sock file. Communication with container from docker daemon.
by default you have to edit
/etc/docker/daemon.json
file content:
{
"hosts": ["unix:///var/run/docker.sock", "tcp://0.0.0.0:2376"]
}
You may also add other sockets if you need / want.
If you want to use some web client you might need to add CORS:
{
"api-enable-cors": true,
"api-cors-header": "*",
"hosts": ["unix:///var/run/docker.sock", "tcp://0.0.0.0:2375"]
}
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