typora/note/devops/docker/远程管理docker.md
2024-12-12 10:48:55 +08:00

591 B
Raw Permalink Blame History

/etc/docker/daemon.json

  • 在原有基础上增加hosts部分
{
	"hosts": ["unix:///var/run/docker.sock", "tcp://0.0.0.0:2375"]
}

docker启动脚本systemctl service方式

  • 停止dockersystemctl stop docker

  • 修改/usr/lib/systemd/system/docker.service保留 dockerd就可以

    image-20240914172847794

  • systemctl daemon-reload

  • systemctl start docker

  • netstat -nlp | grep 2375

  • lsof -i:2375

远程连接

docker -H192.168.0.3 ps