Centos7配置Docker镜像加速器(报错Error response from daemon: pull access denied for centos7, repository does )

我们在日常学习或者使用docker的时候可能会遇到下载安装镜像速度慢的问题,这里我们就得添加以下中国的阿里云镜像就会速度加快。

但是在添加阿里云镜像后会出现身份验证的报错信息:

Error response from daemon: pull access denied for centos7, repository does not exist or may require 'docker login': denied: requested access to the resource is denied

第一步:添加阿里云镜像

在阿里云主页搜索:镜像  或  容器镜像服务即可

https://www.aliyun.com/

Centos7配置Docker镜像加速器(报错Error response from daemon: pull access denied for centos7, repository does )_第1张图片

 第二步:进入容器镜像服务控制台

点击镜像工具 

Centos7配置Docker镜像加速器(报错Error response from daemon: pull access denied for centos7, repository does )_第2张图片

 第三步:按照官网文档复制粘贴即可

选择自己的Linux版本

Centos7配置Docker镜像加速器(报错Error response from daemon: pull access denied for centos7, repository does )_第3张图片

 按照命令粘贴执行即可

sudo mkdir -p /etc/docker
sudo tee /etc/docker/daemon.json <<-'EOF'
{
  "registry-mirrors": ["https://wgqumcjo.mirror.aliyuncs.com"]
}
EOF
sudo systemctl daemon-reload
sudo systemctl restart docker

第四步:拉取镜像报错

[root@centos7 ~]# docker pull centos7
Using default tag: latest
Error response from daemon: pull access denied for centos7, repository does not exist or may require 'docker login': denied: requested access to the resource is denied

第五步:报错解决

出现此问题的原因为未进行身份识别

①点击实例列表进行创建

Centos7配置Docker镜像加速器(报错Error response from daemon: pull access denied for centos7, repository does )_第4张图片

 ②点击访问凭证

Centos7配置Docker镜像加速器(报错Error response from daemon: pull access denied for centos7, repository does )_第5张图片③将代码复制到自己的终端中执行

[root@centos7 ~]# docker login --username=15754855859 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

 password:输入自己的阿里云密码

第六步:搜索镜像进行拉取即可

[root@centos7 ~]# docker search centos7
NAME                                DESCRIPTION                                     STARS     OFFICIAL   AUTOMATED
ansible/centos7-ansible             Ansible on Centos7                              137                  [OK]
rpmbuild/centos7                    CentOS 7 RPM package building environment       16                   
couchbase/centos7-systemd           centos7-systemd images with additional debug…   6                    [OK]
paigeeworld/centos7                 Centos7 with apache, iperf3, nmap, ssh          6                    
ryanj/centos7-s2i-nodejs            STOP RUNNING YOUR APP BUILDS AS ROOT!! Use t…   5                    


[root@centos7 ~]# docker pull ansible/centos7-ansible
Using default tag: latest
latest: Pulling from ansible/centos7-ansible
45a2e645736c: Pull complete 
1c3acf573616: Pull complete 
edcb61e55ccc: Pull complete 
cbae31bad30a: Pull complete 
aacbdb1e2a62: Pull complete 
fdeea4fb835c: Pull complete 
Digest: sha256:39eff7d56b96530d014083cd343f7314c23acbd1ecf37eb75a71a2f6584d0b02
Status: Downloaded newer image for ansible/centos7-ansible:latest
docker.io/ansible/centos7-ansible:latest

 

docker镜像加速报错解决!!!

你可能感兴趣的:(docker,阿里云,容器)