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

前端 未结 9 954
野性不改
野性不改 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:51

    Well i have face a lot of issue in spinning on demand slave from jenkins because of docker daemon port restrictions.

    so i did

    sudo systemctl edit docker.service

    Added below section

    [Service]
    ExecStart=
    ExecStart=/usr/bin/docker daemon --host=tcp://0.0.0.0:2375
    

    Save the file

    run below command

    $ sudo systemctl daemon-reload
    $ sudo systemctl restart docker.service
    

    **NOTE: This will expose your daemon publicly and anyone with your ip and port can do any thing with your docker daemon **

    0 讨论(0)
  • 2020-12-13 10:54

    I had the same issue.

    Ubuntu 14.10 uses systemd instead of sysv-init/upstart. Maybe you should look into /lib/systemd/system/docker.service to change the options.

    0 讨论(0)
  • 2020-12-13 10:54

    I've just run into the "same" problem.

    I noticed that all the options in the /etc/default/docker are actually commented out by default.

    I removed the # in front of DOCKER_OPTS, restarted and it worked as intended.

    I think previous docker versions (1.3) didn't have these options commented out by default, at least I can't remember having to remove the #-sign.

    0 讨论(0)
提交回复
热议问题