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版本
相关推荐
Irene199111 小时前
Win11 自动更新导致 Docker Desktop 无法正常启动,Oracle SQL Developer 启动时报错
docker·更新
darkdragonking13 小时前
OpenEuler 22.03 ,以docker ce 安装 Milvus 及可视化工具
docker·容器·milvus
我叫张土豆15 小时前
V100 显卡部署 Qwen3-ASR-1.7B 语音识别模型(vLLM + Docker 完整教程)
docker·语音识别·vllm
极客先躯17 小时前
高级java每日一道面试题-2026年01月18日-实战篇[Docker]-如何清理仓库中的旧镜像?
java·运维·docker·容器
木雷坞19 小时前
Docker Hub、GHCR、Quay 混在一起后,镜像源要分开测
运维·docker
qq_4523962319 小时前
第十五篇:《Docker 与 Kubernetes 集成:从 Swarm 到 K8s 的迁移》
docker·容器·kubernetes
lpfasd12320 小时前
docker中默认网络的作用和注意事项
网络·docker·容器
EntyIU20 小时前
DOCKER_CHEATSHEET
运维·docker·容器
颜淡慕潇20 小时前
低成本搭建鸿蒙PC运行环境:基于 Docker 的 x86_64 服务器
服务器·docker·harmonyos
SilentSamsara20 小时前
Python 与 Docker:多阶段构建、最小镜像与健康检查
运维·开发语言·python·docker·中间件·容器