Docker
-
Download docker installation package
- Internet-accessible server
- Server without internet access
wget https://pdpublic.mingdao.com/private-deployment/offline/common/docker-28.5.2.tgz# Docker installation package download link, after downloading, upload to the deployment serverhttps://pdpublic.mingdao.com/private-deployment/offline/common/docker-28.5.2.tgz -
Extract and move files to the binary directory
tar -zxvf docker-28.5.2.tgzmv -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-rootvalue in thedaemon.jsonconfiguration 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}],"log-driver": "json-file","log-opts": {"max-size": "1g","max-file": "5"}}EOF -
Configure systemd to manage docker
cat > /etc/systemd/system/docker.service <<EOF[Unit]Description=DockerAfter=network-online.targetWants=network-online.target[Service]Type=notifyExecStart=/usr/local/bin/dockerdExecReload=/bin/kill -s HUP \$MAINPIDLimitNOFILE=102400LimitNPROC=infinityLimitCORE=0TimeoutStartSec=0Delegate=yesKillMode=processRestart=on-failureStartLimitBurst=3StartLimitInterval=60s[Install]WantedBy=multi-user.targetEOF -
Start docker
systemctl daemon-reload && systemctl start docker && systemctl enable docker