DOCKER_OPTS do not work in config file /etc/default/docker

前端 未结 9 979
野性不改
野性不改 2020-12-13 09:59

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

9条回答
  •  南方客
    南方客 (楼主)
    2020-12-13 10:31

    Using the platform independent daemon-configuration-file seems much cleaner.

    Add "hosts" to your /etc/docker/daemon.json (or /custom/path/to/daemon/config.json if you're using --config-file option while starting the dockerd):

    {
    ...
    "hosts": ["tcp://127.0.0.1:2375", "unix:///var/run/docker.sock"],
    ...
    }
    

    restart the daemon:

    sudo systemctl restart docker
    

提交回复
热议问题