Docker
-
Download docker installation package
- Internet-accessible server
- Server without internet access
wget https://pdpublic.mingdao.com/private-deployment/offline/common/docker-27.3.1.tgz
# Docker installation package download link, after downloading, upload to the deployment server
https://pdpublic.mingdao.com/private-deployment/offline/common/docker-27.3.1.tgz -
Extract and move files to the binary directory
tar -zxvf docker-27.3.1.tgz
mv -f docker/* /usr/local/bin/
-
Create docker configuration file
The default docker data directory is /data/docker. If you need to change the default data directory, modify the
data-root
value in thedaemon.json
configuration filemkdir -p /etc/docker/
cat > /etc/docker/daemon.json <<EOF
{
"registry-mirrors": ["https://uvlkeb6d.mirror.aliyuncs.com"],
"data-root": "/data/docker",
"max-concurrent-downloads": 10,
"exec-opts": ["native.cgroupdriver=cgroupfs"],
"storage-driver": "overlay2",
"default-address-pools":[{"base":"172.80.0.0/16","size":24}]
}
EOF -
Configure systemd to manage docker
cat > /etc/systemd/system/docker.service <<EOF
[Unit]
Description=Docker
After=network-online.target
Wants=network-online.target
[Service]
Type=notify
ExecStart=/usr/local/bin/dockerd
ExecReload=/bin/kill -s HUP \$MAINPID
LimitNOFILE=102400
LimitNPROC=infinity
LimitCORE=0
TimeoutStartSec=0
Delegate=yes
KillMode=process
Restart=on-failure
StartLimitBurst=3
StartLimitInterval=60s
[Install]
WantedBy=multi-user.target
EOF -
Start docker
systemctl daemon-reload && systemctl start docker && systemctl enable docker