搜索:find / -name docker.service

    1. 结果:/lib/systemd/system/docker.service
    2. 编辑:vi /lib/systemd/system/docker.service
    3. 修改[Service]区ExecStart行为下面的内容
    1. [Service]
    2. Type=notify
    3. # the default is not to use systemd for cgroups because the delegate issues still
    4. # exists and systemd currently does not support the cgroup feature set required
    5. # for containers run by docker
    6. ExecStart=/usr/bin/dockerd -H tcp://0.0.0.0:2375 -H unix://var/run/docker.sock --containerd=/run/containerd/containerd.sock
    7. ExecReload=/bin/kill -s HUP $MAINPID
    8. TimeoutSec=0
    9. RestartSec=2
    10. Restart=always
    11. 在原本的ExecStart中添加tcp://0.0.0.0:2375
    1. 重启docker 守护进程和docker.service
    1. systemctl daemon-reload
    2. systemctl restart docker.service
    3. systemctl start docker.service