本文共 1314 字,大约阅读时间需要 4 分钟。
按流量计费设置使用ALI镜像源:
mirrors.aliyuncs.com
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
wget -O //yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repoyum makecache
使用 EPEL 库安装 Docker
rpm -e lvm2-7:2.02.105-14.el7.x86_64
curl -sSL http://acs-public-mirror.oss-cn-hangzhou.aliyuncs.com/docker-engine/intranet | sh -
您可以使用如下的脚本将mirror的配置添加到docker daemon的启动参数中。
# 系统要求 CentOS 7 以上,Docker 1.9 以上。sudo cp -n /lib/systemd/system/docker.service /etc/systemd/system/docker.servicesudo sed -i "s|ExecStart=/usr/bin/docker daemon|ExecStart=/usr/bin/docker daemon --registry-mirror=https://s99qctbi.mirror.aliyuncs.com|g" /etc/systemd/system/docker.servicesudo systemctl daemon-reloadsudo service docker restart
service docker start
#docker pull mysql:5.7 从Docker Hub 仓库中下载镜像
//阿里DOCKER仓库 http://dev.aliyun.com/search.html?spm=5176.775974865.0.0.wCqg8O
docker pull registry.mirrors.aliyuncs.com/library/mysql
docker images
docker run -i -t registry.mirrors.aliyuncs.com/library/centos /bin/bash
service docker restart
转载地址:http://uiuhf.baihongyu.com/