docker配置远程连接,dockerfile-maven-plugin插件打包到远程-服务端配置

时间:2025-04-10 09:26:35

docker服务端默认只能本地连接,需要开启tcp连接方式,打开文件/usr/lib/systemd/system/docker.service文件找到以下第六行的配置修改,增加-H tcp://0.0.0.0:2375

[Service]
Type=notify
# the default is not to use systemd for cgroups because the delegate issues still
# exists and systemd currently does not support the cgroup feature set required
# for containers run by docker
ExecStart=/usr/bin/dockerd -H tcp://0.0.0.0:2375 -H fd:// --containerd=/run/containerd/containerd.sock
ExecReload=/bin/kill -s HUP $MAINPID
TimeoutStartSec=0
RestartSec=2
Restart=always

保存重启docker服务端:
systemctl daemon-reload && systemctl restart docker