Set Docker_Opts in centos

后端 未结 12 1713
我在风中等你
我在风中等你 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:33

    In RHEL7, instead of modifying your docker.service unit file, you can also just edit your /etc/sysconfig/docker file:

    # /etc/sysconfig/docker
    
    # Modify these options if you want to change the way the docker daemon runs
    OPTIONS=--selinux-enabled -H unix:///var/run/docker.sock -H tcp://0.0.0.0:4243
    

    and then restart your docker service.

    To me, this is more reliable than modifying the service script.

提交回复
热议问题