Bootstrap

docker运维常见问题汇总

docker pull image denied: requested access to the resource is denied

[root@work-mysql5 ~]# docker push 10.10.10.77/lucksoft/nginx:1.2.0
The push refers to repository [10.10.10.77/lucksoft/nginx]
e1c648953b31: Preparing 
1558c7703dda: Preparing 
57644109adf3: Preparing 
e25aee8ac6bc: Preparing 
077cc6497d08: Preparing 
e7f0c74063fd: Waiting 
966ffafad59a: Waiting 
980678415913: Waiting 
0784babe19db: Waiting 
89ab1f097d35: Waiting 
8ce178ff9f34: Waiting 
denied: requested access to the resource is denied

Error response from daemon: Get https://10.10.10.62:6000/v2/: http: server gave HTTP response to HTTPS client

问题详细:

[root@work-mysql5 ~]# docker pull 10.10.10.62:6000/lucksoft/nginx:1.2.0
Error response from daemon: Get https://10.10.10.62:6000/v2/: http: server gave HTTP response to HTTPS client

解决办法:

未在docker配置文件中添加–insecure-registry信任关系!

vi /etc/docker/daemon.json
daemon配置
调整配置文件后:

1.重载service文件
systemctl daemon-reload   
2.重启docker service 
systemctl restart docker

docker login相关问题

解决办法:

[root@work-mysql5 ~]# docker login 10.10.10.77  -u admin -p Harbor****
WARNING! Using --password via the CLI is insecure. Use --password-stdin.
Error response from daemon: Get https://10.10.10.77%C2%A0/v2/: dial tcp: lookup 10.10.10.77 : no such host

解决办法:

[root@work-mysql5 ~]# echo "Harbor****" | docker login 10.10.10.77 -u admin --password-stdin
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
;