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

你可能感兴趣的文章
PIL.Image进行图像融合显示(Image.blend)
查看>>
pilicat-dfs 霹雳猫-分布式文件系统
查看>>
Pillow lacks the JPEG 2000 plugin
查看>>
SpringBoot之ElasticsearchRestTemplate常用示例
查看>>
ping 全网段CMD命令
查看>>
ping 命令的七种用法,看完瞬间成大神
查看>>
Pinia入门(快速上手)
查看>>
Pinia:$patch的使用场景
查看>>
Pinia:$subscribe()的使用场景
查看>>
Pinpoint对Kubernetes关键业务模块进行全链路监控
查看>>
Pinterest 大规模缓存集群的架构剖析
查看>>
pintos project (2) Project 1 Thread -Mission 1 Code
查看>>
PinYin4j库的使用
查看>>
PIP
查看>>
pip install goose-extractor // SyntaxError: Missing parentheses in call to 'print'
查看>>
pip install mysqlclient报错
查看>>
pip install 出现报asciii码错误的解决
查看>>
pip throws TypeError: parse() got an unexpected keyword argument ‘transport_encoding‘ 在尝试安装新软件包时
查看>>
pip 下载慢
查看>>
pip 升级报错AttributeError: ‘NoneType’ object has no attribute ‘bytes’
查看>>