Docker (八)aliyun私有仓库加速器

安装docker

CentOS 7 (使用yum进行安装)
# step 1: 安装必要的一些系统工具
sudo yum install -y yum-utils device-mapper-persistent-data lvm2
# Step 2: 添加软件源信息
sudo yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
# Step 3: 更新并安装 Docker-CE
sudo yum makecache fast
sudo yum -y install docker-ce
# Step 4: 开启Docker服务
sudo service docker start

使用aliyun加速器

去aliyun开通镜像仓库:
https://cr.console.aliyun.com
使用aliyun加速:
mkdir -p /etc/docker
sudo tee /etc/docker/daemon.json <<-'EOF'
{
  "registry-mirrors": ["https://fgl80ig9.mirror.aliyuncs.com"]
}
EOF
sudo systemctl daemon-reload
sudo systemctl restart docker


cat /etc/docker/daemon.json
{"registry-mirrors": ["https://fgl80ig9.mirror.aliyuncs.com","http://04be47cf.m.daocloud.io"]}

aliyun私有仓库:

# docker login --username=zmjllj@163.com registry.cn-hangzhou.aliyuncs.com
Password: 
WARNING! Your password will be stored unencrypted in /root/.docker/config.json.
Configure a credential helper to remove this warning. See
https://docs.docker.com/engine/reference/commandline/login/#credentials-store

Login Succeeded

对应aliyun打标签:
# docker tag wordpress/v1:self registry.cn-hangzhou.aliyuncs.com/zhongmj/test:latest

上传镜像:
# docker push registry.cn-hangzhou.aliyuncs.com/zhongmj/test:latest
The push refers to repository [registry.cn-hangzhou.aliyuncs.com/zhongmj/test]
14d1cebf2db8: Pushed 
1fe3bf02e29b: Pushed 
4e215657d0fe: Pushed 
b8500ad46143: Pushed 
d7447f749047: Pushed 
b3c5183b2d97: Pushed 
504f84a2c59e: Pushed 
d69483a6face: Pushed 
latest: digest: sha256:c7ecac75643e79d7f66b4a2eabc09805c8404b658fb33e9fcca12ed7c0901826 size: 1993

拉取镜像:
# docker pull registry.cn-hangzhou.aliyuncs.com/zhongmj/test:latest
latest: Pulling from zhongmj/test
Digest: sha256:c7ecac75643e79d7f66b4a2eabc09805c8404b658fb33e9fcca12ed7c0901826
Status: Downloaded newer image for registry.cn-hangzhou.aliyuncs.com/zhongmj/test:latest
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值