docker 离线安装教程(装不上你砍我)

1.最关键点

查看操作系统架构  下载二进制包一定要下载对应的

Index of linux/static/stable/ (docker.com)

[root@Host-HLW-2 docker]# uname -m

 

2.随便把二进制包上传到linux的一个包里

3. 把tgz包解压 并把解压后的所有文件放到usr/bin 里面 

tar -xvf docker-20.10.9\ \(1\).tgz

cp -p docker/* /usr/bin

4. 编写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
# the default is not to use systemd for cgroups because the delegate issues still
# exists and systemd currently does not support the cgroup feature set required
# for containers run by docker
ExecStart=/usr/bin/dockerd
ExecReload=/bin/kill -s HUP $MAINPID
# Having non-zero Limit*s causes performance problems due to accounting overhead
# in the kernel. We recommend using cgroups to do container-local accounting.
LimitNOFILE=infinity
LimitNPROC=infinity
LimitCORE=infinity
# Uncomment TasksMax if your systemd version supports it.
# Only systemd 226 and above support this version.
#TasksMax=infinity
TimeoutStartSec=0
# set delegate yes so that systemd does not reset the cgroups of docker containers
Delegate=yes
# kill only the docker process, not all processes in the cgroup
KillMode=process
# restart the docker process if it exits prematurely
Restart=on-failure
StartLimitBurst=3
StartLimitInterval=60s

[Install]
WantedBy=multi-user.target

5.给配置文件权限

 
 

chmod +x /etc/systemd/system/docker.service

6.重新加载配置

 
 

systemctl daemon-reload

7 启动docker

 
 
 
 

systemctl start docker

8.开机自启

 
 

systemctl enable docker.service

猜你喜欢

转载自blog.csdn.net/qq_62646841/article/details/138906828