博客
关于我
Linux下CentOS7系统安装Docker(安装和卸载)
阅读量:678 次
发布时间:2019-03-15

本文共 773 字,大约阅读时间需要 2 分钟。

安装 Docker 之前,请确保系统环境符合要求。

1. 确认内核版本

请执行以下命令查看内核版本:

uname -r

确保内核版本至少为 3.10.0。

2. 更新 YUM 包

执行系统更新:

sudo yum update

确认更新完成后再继续。

3. 安装必要软件包

安装必要的软件包:

sudo yum install -y yum-utils device-mapper-persistent-data lvm2

4. 设置 YUM 源

添加 Docker 仓库源:

sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo

5. 查看选项

列出可用的 Docker 版本并选择适合的版本:

yum list docker-ce | sort -r

根据需求选择特定版本安装。

6. 安装 Docker

安装指定版本:

sudo yum install -y docker-ce-17.12.0.ce

注意: 根据需要选择合适的 Docker 版本。

7. 启动服务

启动 Docker 服务并设置开机启动:

sudo systemctl start dockersudo systemctl enable docker

8. 验证安装

确保 Docker 安装成功:

docker version

查看以下状态确认服务是否正常运行:

systemctl status docker

9. 卸载 Docker

当需要卸载时,执行以下步骤:

sudo yum remove docker-ce.x86_64

清理 Docker 数据:

rm -rf /var/lib/docker

请注意,卸载前务必备份重要数据。

转载地址:http://pehmz.baihongyu.com/

你可能感兴趣的文章
Qt笔记——获取位置信息的相关函数
查看>>
POJ 2484 A Funny Game(神题!)
查看>>
POJ 2486 树形dp
查看>>
POJ 2488:A Knight's Journey
查看>>
SpringBoot为什么易学难精?
查看>>
poj 2545 Hamming Problem
查看>>
poj 2723
查看>>
poj 2763 Housewife Wind
查看>>
Qt笔记——模型/视图MVD 文件目录浏览器软件
查看>>
POJ 2892 Tunnel Warfare(树状数组+二分)
查看>>
poj 2965 The Pilots Brothers' refrigerator-1
查看>>
poj 3026( Borg Maze BFS + Prim)
查看>>
POJ 3041 - 最大二分匹配
查看>>
POJ 3041 Asteroids(二分匹配模板题)
查看>>
Qt笔记——标准文件对话框QFileDialog
查看>>
poj 3083 Children of the Candy Corn
查看>>
POJ 3083 Children of the Candy Corn 解题报告
查看>>
POJ 3253 Fence Repair C++ STL multiset 可解 (同51nod 1117 聪明的木匠)
查看>>
Qt笔记——控件总结
查看>>
poj 3262 Protecting the Flowers 贪心
查看>>