一,下载docker的tar包

如果在服务器中wegt下载失败,
可以直接去官网下载然后上传到服务器。

wget https://download.docker.com/linux/static/stable/x86_64/docker-28.3.0.tgz

二,部署docker

解压下载的tar包,并把解压出目录下所有内容拷贝到/usr/bin/下
tar xf docker-28.3.0.tgz 
cp docker/* /usr/bin/
——————————————----——————————----————————
配置docker的启动方式
vi /etc/systemd/system/docker.service
[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 --selinux-enabled=false 
ExecReload=/bin/kill -s HUP $MAINPID
LimitNOFILE=infinity
LimitNPROC=infinity
LimitCORE=infinity
TimeoutStartSec=0
Delegate=yes
KillMode=process
Restart=on-failure
StartLimitBurst=3
StartLimitInterval=60s
[Install]
WantedBy=multi-user.target
chmod 777 /etc/systemd/system/docker.service
——————----——————————----————————————————
重新加载systemd的配置文件,并设置docker的开机自启
systemctl daemon-reload && systemctl enable docker.service
启动并检查docker的状态
systemctl restart docker
docker info
————————————-----————————————————--
配置docker的守护进程文件
mkdir -p /etc/docker

vi /etc/docker/daemon.json
{
  "exec-opts": ["native.cgroupdriver=systemd"],
  "log-driver": "json-file",
  "log-opts": {
    "max-size": "100m"
  },
  "max-concurrent-downloads": 30,
  "max-concurrent-uploads": 15,
  "registry-mirrors": ["https://t3xbrfwz.mirror.aliyuncs.com"],
  "live-restore": true
}
systemctl daemon-reload && systemctl restart docker

Logo

腾讯云面向开发者汇聚海量精品云计算使用和开发经验,营造开放的云计算技术生态圈。

更多推荐