centos7.6安装docker-ce

1、安装依赖

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

 

2、添加软件源(使用阿里源)  

yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
#查看是否下载成功
ls /etc/yum.repos.d/ | grep docker
docker-ce.repo

 

3、安装docker-ce

yum -y install docker-ce

  

4、启动docker,查看版本

systemctl start docker
#查看版本信息
docker version

Client: Docker Engine - Community
 Version:           19.03.8
 API version:       1.40
 Go version:        go1.12.17
 Git commit:        afacb8b
 Built:             Wed Mar 11 01:27:04 2020
 OS/Arch:           linux/amd64
 Experimental:      false

Server: Docker Engine - Community
 Engine:
  Version:          19.03.8
  API version:      1.40 (minimum version 1.12)
  Go version:       go1.12.17
  Git commit:       afacb8b
  Built:            Wed Mar 11 01:25:42 2020
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          1.2.13
  GitCommit:        7ad184331fa3e55e52b890ea95e65ba581ae3429
 runc:
  Version:          1.0.0-rc10
  GitCommit:        dc9208a3303feef5b3839f4323d9beb36df0a9dd
 docker-init:
  Version:          0.18.0
  GitCommit:        fec3683

  

5、配置docker镜像加速

#Docker 官方中国区
https://registry.docker-cn.com
#网易
http://hub-mirror.c.163.com
#ustc
https://docker.mirrors.ustc.edu.cn
#阿里
进入阿里云----搜索容器镜像服务----镜像加速

  

修改 /etc/docker/daemon.json 文件并添加上 registry-mirrors 键值。

{
  "registry-mirrors": ["http://hub-mirror.c.163.com"]
}

 重启docker

systemctl daemon-reload
systemctl restart docker

  

posted @ 2020-04-08 14:00  风之老凌  阅读(261)  评论(0编辑  收藏  举报