Set Docker_Opts in centos

后端 未结 12 2059
我在风中等你
我在风中等你 2021-01-31 04:44

I need to set docker to listen to tcp://0.0.0.0/4243 on my host machine running amazon linux (centos). All the documentation I have seen has told me to run the following command

12条回答
  •  情书的邮戳
    2021-01-31 05:20

    I cannot believe how many answers there are for this. So here is another one for:

    • CentOS 7.3
    • Docker Version = 17.03.1-ce, API Version = 1.27

    This answer is built upon an unbelievable playing around combination of this answer and this one and this one.

    1. sudo vim /usr/lib/systemd/system/docker.service
    2. insert " -H tcp://0.0.0.0:4243 -H unix:///var/run/docker.sock"
    3. sudo systemctl daemon-reload //refresh your file changes above
    4. sudo systemctl restart docker
    5. netstat -l | grep 4243 //verify port is open
    6. connect to your docker host from somewhere, like Jenkins Docker Plugin, i.e. tcp://[server_ip]:4243

提交回复
热议问题