Docker离线安装

1 下载离线安装包

下载地址:

https://download.docker.com/linux/static/stable/x86_64/

2 解压安装包

         解压命令:tar -xvf docker-20.10.9.tgz 

3 移动文件至bin

        cp docker/* /usr/bin/        

4 将docker注册为service

        vim /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

ExecReload=/bin/kill -s HUP $MAINPID

LimitNOFILE=infinity

LimitNPROC=infinity

TimeoutStartSec=0

Delegate=yes

KillMode=process

Restart=on-failure

StartLimitBurst=3

StartLimitInterval=60s

 

[Install]

WantedBy=multi-user.target

 5 启动

chmod +x /etc/systemd/system/docker.service      #添加文件权限并启动docker
systemctl daemon-reload        #重载unit配置文件
systemctl start docker         #启动Docker
systemctl enable docker.service    #设置开机自启
docker -v    #查看docker版本

你可能感兴趣的:(Docker学习笔记,docker,容器,运维)