我正在尝试将ubuntu上的docker网络更改为docker 0(10.10.10.10/24系列)。我在/etc/systemd/system/docker.service.d路径中创建了docker.conf文件,我的docker版本是18.09.0。
以下是docker.conf文件:
[Unit]
Description=Docker Application Container Engine
Documentation=https://docs.docker.com
BindsTo=containerd.service
After=network-online.target firewalld.service
Wants=network-online.target
[Service]
Type=notify
# the default is not to use systemd for cgroups because the delegate issues stil l
# exists and systemd currently does not support the cgroup feature set required
# for containers run by docker
ExecStart=/usr/bin/dockerd -H fd:// --bip=10.10.10.10/24
ExecReload=/bin/kill -s HUP $MAINPID
LimitNOFILE=1048576
# Having non-zero Limit*s causes performance problems due to accounting overhead
# in the kernel. We recommend using cgroups to do container-local accounting.
LimitNPROC=infinity
LimitCORE=infinity
# Uncomment TasksMax if your systemd version supports it.
# Only systemd 226 and above support this version.
TasksMax=infinity
TimeoutStartSec=0
# set delegate yes so that systemd does not reset the cgroups of docker containe rs
Delegate=yes
# kill only the docker process, not all processes in the cgroup
KillMode=process
# restart the docker process if it exits prematurely
Restart=on-failure
StartLimitBurst=3
StartLimitInterval=60s
[Install]
WantedBy=multi-user.target
此后,我跟随this link
有人可以建议如何将我的默认网络更改为docker 0吗?
答案 0 :(得分:0)
在大多数平台上,添加了一个docker用户组,但是取决于您是否将其添加到安装程序。我要自己添加usermod -aG docker <user>
,然后注销并重新登录,看看是否可以访问它。
Docker套接字/var/run/docker.sock是作为文件访问的网络套接字,这意味着它具有文件许可权,并且在大多数情况下,它是Docker组中的root用户所拥有,从而允许docker组执行以下操作:访问和使用它。