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

你可能感兴趣的文章
notepad如何自动对齐_notepad++怎么自动排版
查看>>
Notes on Paul Irish's "Things I learned from the jQuery source" casts
查看>>
Notification 使用详解(很全
查看>>
NotImplementedError: Cannot copy out of meta tensor; no data! Please use torch.nn.Module.to_empty()
查看>>
NotImplementedError: Could not run torchvision::nms
查看>>
nova基于ubs机制扩展scheduler-filter
查看>>
Now trying to drop the old temporary tablespace, the session hangs.
查看>>
nowcoder—Beauty of Trees
查看>>
np.arange()和np.linspace()绘制logistic回归图像时得到不同的结果?
查看>>
np.power的使用
查看>>
NPM 2FA双重认证的设置方法
查看>>
npm build报错Cannot find module ‘webpack/lib/rules/BasicEffectRulePlugin‘解决方法
查看>>
npm build报错Cannot find module ‘webpack‘解决方法
查看>>
npm ERR! ERESOLVE could not resolve报错
查看>>
npm ERR! fatal: unable to connect to github.com:
查看>>
npm ERR! Unexpected end of JSON input while parsing near '...on":"0.10.3","direc to'
查看>>
npm ERR! Unexpected end of JSON input while parsing near ‘...“:“^1.2.0“,“vue-html-‘ npm ERR! A comp
查看>>
npm error Missing script: “server“npm errornpm error Did you mean this?npm error npm run serve
查看>>
npm error MSB3428: 未能加载 Visual C++ 组件“VCBuild.exe”。要解决此问题,1) 安装
查看>>
npm install CERT_HAS_EXPIRED解决方法
查看>>