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版本
相关推荐
萌萌哒草头将军6 小时前
绿联云 NAS 安装 AudioDock 详细教程
前端·docker·容器
apocelipes7 小时前
docker-compose 部署单节点 kafka 4.0 测试环境
docker·golang·kafka·开发工具和环境
m0_4887776513 小时前
运用Docker-compose编排部署设备管理平台(包含nginx的https访问)
docker·容器·docker-compose·服务统一管理
我爱学习好爱好爱14 小时前
Docker Compose部署SpringBoot2+Vue3+redis项目(Rockylinux9.6)
redis·docker·容器
tzhou6445214 小时前
Docker Compose 编排与 Harbor 私有仓库
运维·docker·容器
摇滚侠14 小时前
CentOS 7 Linux 离线安装 Docker:离线安装包、依赖文件、安装步骤
linux·docker·centos
计算机小手15 小时前
Kong + Konga 网关入门实践:Docker 部署、反向代理与插件使用指南
运维·经验分享·网络协议·docker·kong·开源软件
特级业务专家15 小时前
这下发布不需要Jenkins了
linux·git·docker
回忆是昨天里的海15 小时前
docker自定义网络-简单总结
运维·docker·容器
.生产的驴16 小时前
DockerCompoe 部署注册中心Nacos 一键部署 单机+Mysql8
java·linux·运维·spring boot·缓存·docker·doc