I have changed /etc/default/docker
with DOCKER_OPTS=\"-H tcp://127.0.0.1:2375 -H unix:///var/run/docker.sock\"
(docker version 1.4.1 in ubuntu 14.0
According to docker documentation, The recommended way to configure the daemon flags and environment variables for your Docker daemon is to use a systemd drop-in file.
So, for this specific case, do the following:
Use the command sudo systemctl edit docker.service
to open an override file for docker.service
in a text editor.
Add or modify the following lines, substituting your own values.
[Service]
ExecStart=
ExecStart=/usr/bin/dockerd -H tcp://127.0.0.1:2375 -H unix:///var/run/docker.sock
Save the file.
Reload the systemctl
configuration.
$ sudo systemctl daemon-reload
Restart Docker:
$ sudo systemctl restart docker.service
Check to see whether the change was honored by reviewing the output of netstat
to confirm dockerd
is listening on the configured port.
$ sudo netstat -lntp | grep dockerd
tcp 0 0 127.0.0.1:2375 0.0.0.0:* LISTEN 3758/dockerd