docs: update docker/install

This commit is contained in:
Administrator 2021-09-02 06:20:06 +00:00 committed by John Smith
parent 029d36e754
commit d3c61fdb9e

View File

@ -2,7 +2,7 @@
title: docker的安装 title: docker的安装
description: docker的安装 description: docker的安装
published: true published: true
date: 2021-08-02T08:28:31.729Z date: 2021-09-02T06:20:04.827Z
tags: docker tags: docker
editor: markdown editor: markdown
dateCreated: 2021-08-02T07:22:52.894Z dateCreated: 2021-08-02T07:22:52.894Z
@ -32,27 +32,35 @@ $ sudo yum remove docker \
docker-logrotate \ docker-logrotate \
docker-engine docker-engine
``` ```
或者查看已经安装的docker
```bash
$ yum list installed |grep docker
```
##### 安装 ##### 安装
[官方安装传送门](https://docs.docker.com/engine/install/centos/)
###### 下载依赖
###### 所需软件包 [选择对应CentOS版本](https://download.docker.com/linux/centos/)
下载stable版本的两个文件这里是CentOS7.5
- docker-ce-selinux-17.03.2.ce-1.el7.centos.noarch.rpm
- docker-ce-17.03.2.ce-1.el7.centos.x86_64.rpm
###### 执行安装
```bash ```bash
$ sudo yum install -y yum-utils device-mapper-persistent-data lvm2 $ yum install -y docker-ce-selinux-17.03.2.ce-1.el7.centos.noarch.rpm
$ yum install -y docker-ce-17.03.2.ce-1.el7.centos.x86_64.rpm
``` ```
#### 启动docker
###### 设置仓库 设置开机启动
阿里云
```bash ```bash
$ sudo yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo $ systemctl enable docker
``` ```
启动
###### 安装 Docker Engine-Community
```bash ```bash
$ yum install docker-ce docker-ce-cli containerd.io $ systemctl start docker
``` ```
#### 删除 #### 删除