Skip to content

Instantly share code, notes, and snippets.

@chroming
Last active November 30, 2020 13:47
Show Gist options
  • Save chroming/e476303eacfd8dd7772d110454bb1836 to your computer and use it in GitHub Desktop.
Save chroming/e476303eacfd8dd7772d110454bb1836 to your computer and use it in GitHub Desktop.
macOS docker使用远程daemon

服务端

假设服务端运行在centos7上: vim /usr/lib/systemd/system/docker.service 修改ExecStart行:

ExecStart=/usr/bin/dockerd -H tcp://0.0.0.0:2375 -H fd:// --containerd=/run/containerd/containerd.sock

https://docs.docker.com/engine/reference/commandline/dockerd/

防火墙开放端口: sudo firewall-cmd --add-port=2375/tcp

重启服务: sudo systemctl daemon-reload sudo systemctl restart docker

客户端

安装

brew install docker

这样只安装docker cli没有desktop。

连接

docker -H tcp://192.168.100.106:2375 images

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment