denied: requested access to the resource is denied

1.vim  /etc/docker/daemon.json    增加一个daemon.json文件

{ "insecure-registries":["192.168.1.100:5000"] }
保存退出

2.重启docker服务
systemctl daemon-reload
systemctl restart docker

 再做个标记 tag

docker tag SOURCE_IMAGE[:TAG] 192.168.9.xx/docker/IMAGE[:TAG]    此句我解释下啊, 第一个 SOURCE_IMAGE[:TAG] 就是 REPOSITORY:TAG ; 文件名, 第二个 IMAGE[:TAG] 

denied: requested access to the resource is denied  SOURCE_IMAGE[:TAG] 就是 xianwei/vimifconfig:latest  ; IMAGE[:TAG]  就是IMAGE 是自己建一个名字 ,想怎么写就怎么写,;[:TAG] 就 是 latest, 如:cnetos:latest 

再上传,push

docker push 192.168.9.xx/docker/IMAGE[:TAG]

 

[root@PROD-MQ ~]# docker logout 192.168.x.xx    // 退出 Harbor ,这个IP 是 Harbor 服务器的IP,
Removing login credentials for 192.168.9.x
[root@PROD-MQ ~]# docker login 192.168.9.x       // 登录 Harbor ,这个IP 是 Harbor 服务器的IP,
Username: liuxian   //此用户名是在 Harbor 上注册了的用户名,可以登录进去的
Password:              //这个密码肯定就是liuxian 的登录密码了;
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  成功登录,
[root@PROD-MQ ~]# docker push 192.168.9.52/docker/vimifconfig:latest    //再进行PUSH ,就会成功啦
The push refers to repository [192.168.9.52/docker/vimifconfig]
9b09ff32b149: Pushed    //传输完成
a1ec00a0e6d0: Pushed  //传输完成
071d8bd76517: Pushed  //传输完成
latest: digest: sha256:90b98dd0bcb65a740276d2b826e893848df5e655f1381b5d95badf5f8ec63bc7 size: 953     //最后成功上传完成。
[root@PROD-MQ ~]#

 

第二个问题是:Get https://192.168.2.119/v2/: dial tcp 192.168.2.119:443: getsockopt: connection refused

denied: requested access to the resource is denied

原因:没有指定镜像要上传的地址,站点。默认的是docker.io

解决方法:docker tag <imagesname> <ip:port/image>

                  docker push ip:port/image 

denied: requested access to the resource is denied

denied: requested access to the resource is denied

 

上一篇:pyserial timeout 参数


下一篇:bs4.FeatureNotFound: Couldn't find a tree builder with the features you requested: lxml.