Docker tips

时间:2023-03-08 17:03:16

1、将Docker daemon的监听端口写入配置文件

配置文件: /etc/default/docker (CentOS: /etc/sysconfig/docker)

写入:DOCKER_OPTS="-H unix:///var/run/docker.sock -H tcp://0.0.0.0:2375"

The -H unix:///var/run/docker.sock configures a local unix socket for Docker to use. This is the default.

The -H tcp://0.0.0.0:2375 option configures Docker to listen on a TCP port

之后重启Docker

sudo restart docker

2、