下载安装包
wget https://download.docker.com/linux/static/stable/x86_64/docker-24.0.6.tgz
安装
tar -zxvf docker-24.0.6.tgz
sudo cp docker/* /usr/bin/
vim /etc/systemd/system/docker.service
chmod +x /etc/systemd/system/docker.service
systemctl daemon-reload
systemctl enable docker.service
systemctl start docker
[Unit]
Description=Docker Application Container Engine
Documentation=https://docs.docker.com
After=network-online.target firewalld.service
Wants=network-online.target
[Service]
Type=notify
ExecStart=/usr/bin/dockerd
ExecReload=/bin/kill -s HUP $MAINPID
LimitNOFILE=infinity
LimitNPROC=infinity
TimeoutStartSec=0
Delegate=yes
KillMode=process
Restart=on-failure
StartLimitBurst=3
StartLimitInterval=60s
[Install]
WantedBy=multi-user.target
配置docker
{
"data-root":"/data/docker",
"log-opts": {
"max-size": "50m",
"max-file":"1"
}
}