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版本
相关推荐
2401_8346369921 分钟前
Docker 容器化技术全解:从镜像构建到容器编排的完整教案2
运维·docker·容器
伞伞悦读3 小时前
【第12期】Windows 开发环境备份与恢复:软件、环境变量、Git、conda 和 Docker 卷完整方案
git·docker·conda
虎王物联4 小时前
Docker WASM 边缘计算:12ms 冷启动如何重塑 IoT 网关部署
物联网·docker·容器·边缘计算·wasm
李少兄5 小时前
Linux 服务器从零部署 kkFileView 完全指南(Docker 方案)
linux·服务器·docker
2301_旺仔5 小时前
【Docker 镜像仓库】
docker·云原生·仓库
2401_834636996 小时前
Docker 容器化技术全解:从镜像构建到容器编排的完整教案1
java·docker·容器
^酸酸6 小时前
Prometheus 监控架构部署实战:二进制与 Docker 双方案
docker·架构·prometheus
青 春 记 忆14 小时前
Dify Docker Compose 通用无损升级指南:从备份、双版本预演到切换与回滚
运维·人工智能·python·docker·容器
Java王小怪16 小时前
Docker环境Redis没挂载保存数据
运维·docker·容器
灰阳阳17 小时前
Docker-数据卷命令解析
java·docker·eureka