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版本
相关推荐
自律最差的编程狗3 小时前
Ubuntu下Docker部署Ollama 轻量模型
linux·ubuntu·docker
wdfk_prog4 小时前
大型 Docker 镜像导出导入工程化:可靠性、磁盘与压缩
运维·docker·容器
郝开4 小时前
Docker Compose 模块化多环境配置规范指南:示例搭建Alf Tengine MD2DOC 1.1.1
运维·docker·容器
Albart5755 小时前
Docker Desktop 增量更新失败终极排查:Failed to apply delta update 反复回滚怎么办?
windows·docker·容器·docker部署大模型
sibylyue6 小时前
【云原生系列3】Docker Compose单机多容器编排工具
运维·docker·容器
java_logo7 小时前
Docker 部署 ArchivesSpace:轻松搭建档案信息管理平台
运维·docker·容器·档案管理·轩辕镜像·archivesspace·特藏
kuroomi11 小时前
Docker 与容器基础
linux·运维·docker
梦梦代码精16 小时前
《回收租赁系统技术选型避坑指南:业务闭环与二开自由度详解》
开发语言·低代码·docker·开源·代码规范
_itgo17 小时前
意图识别落地方案
运维·docker·容器
java_logo1 天前
Docker 部署 ClickHouse Server:轻松搭建列式 OLAP 分析数据库平台
数据库·clickhouse·docker·私有化部署·olap·列式数据库·轩辕镜像