说明

本教程测试环境为debian9,其他环境中可能会出现报错或安装失败的问题

下载

wget https://download.docker.com/linux/static/stable/x86_64/docker-24.0.2.tgz --no-check-certificate

解压

tar xzvf docker-24.0.2.tgz

复制二进制文件到/usr/bin目录下

cp docker/* /usr/bin/

检查是否安装

docker version

配置 docker.service文件

vim /lib/systemd/system/docker.service

写入内容为:

[Unit]Description=Docker Application Container EngineDocumentation=https://docs.docker.comAfter=network-online.target firewalld.serviceWants=network-online.target[Service]Type=notifyExecStart=/usr/bin/dockerdExecReload=/bin/kill -s HUP $MAINPIDLimitNOFILE=infinityLimitNPROC=infinityTimeoutStartSec=0Delegate=yesKillMode=processRestart=on-failureStartLimitBurst=3StartLimitInterval=60s[Install]WantedBy=multi-user.target

启动dockerd服务进程

systemctl daemon-reloadsystemctl start docker.service

检验

ps aux|grep docker