2、Docker的安装、设置国内镜像源
1、Docker的安装
环境
Linux环境中的Centos7.x以上版本
步骤:
(1)yum 包更新到最新> yum update(2)安装需要的软件包, yum-util 提供yum-config-manager功能,另外两个是devicemapper驱动依赖的> yum install -y yum-utils device-mapper-persistent-data lvm2(3)设置yum源为阿里云> yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo(4)安装docker【docker-ce: 社区版,免费; docker-ee:企业版,收费】> yum install docker-ce -y(5)安装后查看docker版本> docker -v
2、设置ustc镜像源
https://lug.ustc.edu.cn/wiki/mirrors/help/docker
详细操作步骤:
# 编辑该文件:mkdir -p /etc/dockervi /etc/docker/daemon.json # 在该文件中输入如下内容:{"registry-mirrors": ["https://docker.mirrors.ustc.edu.cn"]}# 配置多个如下:{"registry-mirrors": ["https://docker.mirrors.ustc.edu.cn"],"registry-mirrors": ["https://0wrdwnn6.mirror.aliyuncs.com"]}
或者执行
curl -sSL https://get.daocloud.io/daotools/set_mirror.sh | sh -s http://bc437cce.m.daocloud.io