Docker版本:18.06.1安装

1、操作系统:CentOS 7.5以上

2、Docker版本:18.06.1

1、解压

powershell 复制代码
tar -xvf docker-18.06.1-ce.tgz

2、将解压出来的docker文件内容移动到 /usr/bin/ 目录下

powershell 复制代码
cp docker/* /usr/bin/

3、将docker注册为service

powershell 复制代码
vim /etc/systemd/system/docker.service

将下列配置加到docker.service中并保存。

powershell 复制代码
[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

4、启动

powershell 复制代码
chmod  +x /etc/systemd/system/docker.service    #添加文件权限并启动docker
systemctl daemon-reload    #重载unit配置文件
systemctl start docker    #启动Docker
systemctl enable docker.service  #设置开机自启

5、验证

powershell 复制代码
systemctl status docker   #查看Docker状态
docker -v   #查看Docker版本
相关推荐
阿福不是狗4 小时前
Python使用总结之Mac安装docker并配置wechaty
python·macos·docker
藥瓿亭7 小时前
K8S认证|CKS题库+答案| 3. 默认网络策略
运维·ubuntu·docker·云原生·容器·kubernetes·cks
背太阳的牧羊人9 小时前
sudo docker exec -it backend bash 以交互方式(interactive)进入正在运行的 Docker 容器的命令行环境
docker·容器·bash
gsls2008089 小时前
ocrapi服务docker镜像使用
运维·docker·容器
爱宇阳10 小时前
使用 Docker Compose 从零部署 TeamCity + PostgreSQL(详细新手教程)
docker·postgresql·容器
whp40411 小时前
windows server2019 不成功的部署docker经历
运维·docker·容器
木头左14 小时前
Docker容器化技术中的联合文件系统原理探究
docker·容器·eureka
itachi-uchiha15 小时前
Docker部署Hive大数据组件
大数据·hive·docker
deletion丶15 小时前
在 Windows 系统上运行 Docker 容器中的 Ubuntu 镜像并显示 GUI
docker
罗技12319 小时前
我用Amazon Q写了一个Docker客户端,并上架了懒猫微服商店
运维·docker·容器