Set Docker_Opts in centos

后端 未结 12 1679
我在风中等你
我在风中等你 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条回答
  •  闹比i
    闹比i (楼主)
    2021-01-31 05:24

    1、edit /usr/lib/systemd/system/docker.service to add two param in the service section:

    # vim /usr/lib/systemd/system/docker.service
    

    [Service]

    ExecStart=

    ExecStart=/usr/bin/dockerd -H tcp://0.0.0.0:2375 -H unix://var/run/docker.sock

    2、reload the configuration,and then restart docker。

    # systemctl daemon-reload
    # systemctl restart docker
    

    3、to check for success, see if the return the following response。

    # ps -ef|grep docker
    

    root 26208 1 0 23:51 ? 00:00:00 /usr/bin/dockerd -H tcp://0.0.0.0:2375 -H unix://var/run/docker.sock

    reference from Expose the Docker Remote API on Centos 7?

提交回复
热议问题