docker安装

CentOS7.x安装Docker

# 安装依赖包

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

# 添加Docker软件包源

yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo

# 安装最新版Docker CE

yum install -y docker-ce

#安装指定版本,可以使用yum list列出可用的版本:

yum list docker-ce --showduplicates | sort -r

yum install docker-ce-<VERSION_STRING> docker-ce-cli-<VERSION_STRING> containerd.io

比如这里需要安装18.09.9版本

yum -y install docker-ce-18.09.9-3.el7

# 启动Docker服务并设置开机启动

systemctl start docker

systemctl enable docker

官方文档:https://docs.docker.com

阿里云源:http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo

添加 docker 镜像加速:https://www.daocloud.io/mirror

curl -sSL https://get.daocloud.io/daotools/set_mirror.sh | sh -s http://f1361db2.m.daocloud.io

 

posted @ 2020-06-08 16:50  钱哥的博客  阅读(51)  评论(0编辑  收藏  举报