Docker 离线二进制tgz压缩包下载地址:点我下载
Docker安装步骤
确定OS系统环境,CentOS 7/Redhat 7及以上版本【其他】
[root@test soft]# cat /etc/redhat-release
Red Hat Enterprise Linux Server release 7.9 (Maipo)
[root@test soft]# uname -a
Linux test 3.10.0-1160.el7.x86_64 #1 SMP Tue Aug 18 14:50:17 EDT 2020 x86_64 x86_64 x86_64 GNU/Linux
[root@test soft]#
下载离线安装包,上传至服务端并解压
[root@test soft]# tar -zxvf docker-23.0.6.tgz
docker/
docker/docker-proxy
docker/containerd-shim-runc-v2
docker/ctr
docker/docker
docker/docker-init
docker/runc
docker/dockerd
docker/containerd
[root@test soft]#
将解压后得到的二进制文件全复制到/usr/bin目录下
[root@test soft]# cp docker/* /usr/bin/
添加systemd守护进程
[Unit]
Description=Docker Application Container Engine
Documentation=https://docs.docker.com
After=network-online.target firewalld.service
Wants=network-online.target
[Service]
ExecStart=/usr/bin/dockerd
ExecReload=/bin/kill -s HUP $MAINPID
TimeoutSec=0
RestartSec=2
Restart=always
# Note that Docker daemon binds to a Unix socket,
# so it doesn't need network-online.target
# see https://github.com/systemd/systemd/issues/8240#issuecomment-432582007
# Requires=docker.socket
# docker.socket doesn't exist here; omitting.
Requires=network-online.target
[Install]
WantedBy=multi-user.target
增加文件可执行权限&&启动docker
chmod +x /etc/systemd/system/docker.service
systemctl daemon-reload
systemctl enable docker --now
No Comments