博客
关于我
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/

你可能感兴趣的文章
ORCHARD 是什么?
查看>>
Struts2中使用Session的两种方法
查看>>
Stream API:filter、map和flatMap 的用法
查看>>
STM32工作笔记0032---编写跑马灯实验---寄存器版本
查看>>
order by rand()
查看>>
SSM(Spring+SpringMvc+Mybatis)整合开发笔记
查看>>
Orderer节点启动报错解决方案:Not bootstrapping because of 3 existing channels
查看>>
org.apache.axis2.AxisFault: org.apache.axis2.databinding.ADBException: Unexpected subelement profile
查看>>
sql查询中 查询字段数据类型 int 与 String 出现问题
查看>>
org.apache.commons.beanutils.BasicDynaBean cannot be cast to ...
查看>>
org.apache.dubbo.common.serialize.SerializationException: com.alibaba.fastjson2.JSONException: not s
查看>>
sqlserver学习笔记(三)—— 为数据库添加新的用户
查看>>
org.apache.http.conn.HttpHostConnectException: Connection to refused
查看>>
org.apache.ibatis.binding.BindingException: Invalid bound statement错误一例
查看>>
org.apache.ibatis.exceptions.PersistenceException:
查看>>
org.apache.ibatis.exceptions.TooManyResultsException: Expected one result (or null) to be returned
查看>>
org.apache.ibatis.type.TypeException: Could not resolve type alias 'xxxx'异常
查看>>
org.apache.poi.hssf.util.Region
查看>>
org.apache.xmlbeans.XmlOptions.setEntityExpansionLimit(I)Lorg/apache/xmlbeans/XmlOptions;
查看>>
org.apache.zookeeper.KeeperException$ConnectionLossException: KeeperErrorCode = ConnectionLoss for /
查看>>