docker使用阿里云的镜像加速器的地址

docker获取的镜像由于网络的原因,下载速度很慢,个人使用阿里云的镜像加速器,所以介绍如何使用docker获取阿里云上面的镜像。
使用自己的淘宝账号登录阿里云的地址。
1、登录地址:https://cr.console.aliyun.com/cn-hangzhou/new。
在这里插入图片描述
然后:
在这里插入图片描述
密码设置完成之后,进入镜像加速器功能模块下:
在这里插入图片描述
配置:
在这里插入图片描述
1)、创建文件:
vim /etc/docker/daemon.json
然后添加json格式的文件:
{
“registry-mirrors”: [“你在阿里云获取的镜像加速地址”]
}

在这里插入图片描述
2)、重新加载

systemctl daemon-reload

3)、重启docker

systemctl restart docker

如果重启docker失败的可以按照阿里云上的操作:
step:
sudo tee /etc/docker/daemon.json <<-‘EOF’
{
“registry-mirrors”: [“你在阿里云获取的镜像加速地址”]
}
EOF

sudo systemctl daemon-reload
sudo systemctl restart docker

启动成功:
在这里插入图片描述
以上就配置完成了,有兴趣可以去了解使用网易云的镜像地址的配置。
在这里插入图片描述
这里简单测试:利用docker拉去一个镜像。

[root@localhost docker]# docker run hello-world
Unable to find image 'hello-world:latest' locally
latest: Pulling from library/hello-world
1b930d010525: Pull complete 
Digest: sha256:f9dfddf63636d84ef479d645ab5885156ae030f611a56f3a7ac7f2fdd86d7e4e
Status: Downloaded newer image for hello-world:latest

Hello from Docker!
This message shows that your installation appears to be working correctly.

To generate this message, Docker took the following steps:
 1. The Docker client contacted the Docker daemon.
 2. The Docker daemon pulled the "hello-world" image from the Docker Hub.
    (amd64)
 3. The Docker daemon created a new container from that image which runs the
    executable that produces the output you are currently reading.
 4. The Docker daemon streamed that output to the Docker client, which sent it
    to your terminal.

To try something more ambitious, you can run an Ubuntu container with:
 $ docker run -it ubuntu bash

Share images, automate workflows, and more with a free Docker ID:
 https://hub.docker.com/

For more examples and ideas, visit:
 https://docs.docker.com/get-started/
[root@localhost docker]# 

以上就是介绍使用docker命令获取hello-world的镜像的过程,执行过程先是从自己的本地服务器上去找这个镜像。没有这个镜像之后,再去阿里云的服务器上找这个hello-world最新的镜像。
在这里插入图片描述

  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值