贝隆

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

离线:
1. 下载docker安装包: https://download.docker.com/linux/static/stable/x86_64/
2. 准备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
3. 文件:

docker-20.10.10.tgz

docker.service
4. 解压包:
tar -zxvf docker-20.10.10.tgz
5. 将docker⽬录移到/usr/bin⽬录下:
cp docker/* /usr/bin/
6. 将docker.service 移到/etc/systemd/system/ ⽬录:
cp docker.service /etc/systemd/system/
7. 添加⽂件权限:
chmod +x /etc/systemd/system/docker.service
8. 重新加载配置⽂件:
systemctl daemon-reload
9. 启动docker:
systemctl start docke
10. 设置开机⾃启:
systemctl enable docker.service
11. 查看docker版本号:
docker -v

posted on 2019-07-27 15:31  贝隆  阅读(448)  评论(0编辑  收藏  举报