1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54
| [root@dj-virtual-machine /]# docker push 192.168.8.150:88/tensqure/eureka7001:v1 The push refers to repository [192.168.8.150:88/tensqure/eureka7001] Get https://192.168.8.150:88/v2/: http: server gave HTTP response to HTTPS client
# 以上报错,是因为Docker未将Harbor加入到信任列表中 # 将Harbor地址加入Docker信任列表,终端执行以下命令: [root@dj-virtual-machine /]# vim /etc/docker/daemon.json # 可能 daemon.json 文件并不存在,需要自行手动创建。 { "registry-mirrors": [ "https://docker.mirrors.ustc.edu.cn", "https://registry.docker-cn.com", "https://hub-mirror.c.163.com", "https://mirror.ccs.tencentyun.com", "http://f1361db2.m.daocloud.io" ], + "insecure-registries": [ + "192.168.8.150:88" + ] }
# 重启Docker [root@dj-virtual-machine /]# systemctl daemon-reload [root@dj-virtual-machine /]# systemctl restart docker # 启动Harbor [root@dj-virtual-machine /]# cd /home/dj/dev/harbor/harbor1.9.2/ [root@dj-virtual-machine harbor1.9.2]# ./install.sh # 再次推送镜像 [root@dj-virtual-machine harbor1.9.2]# docker push 192.168.8.150:88/tensqure/eureka7001:v1 The push refers to repository [192.168.8.150:88/tensqure/eureka7001] c0b9f3610428: Preparing ceaf9e1ebef5: Preparing 9b9b7f3d56a0: Preparing f1b5933fe4b5: Preparing denied: requested access to the resource is denied
---------- ---------- ----------
# 新的问题,提示权限不足。(因为项目属于私有项目,需要提前登录) [root@dj-virtual-machine ~]# docker login -u tom -p Tom123456 192.168.8.150:88 WARNING! Using --password via the CLI is insecure. Use --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
# 再次Push就好了 [root@dj-virtual-machine harbor1.9.2]# docker push 192.168.8.150:88/tensquare/eureka7001:v1 The push refers to repository [192.168.8.150:88/tensquare/eureka7001] c0b9f3610428: Pushed ceaf9e1ebef5: Pushed 9b9b7f3d56a0: Pushed f1b5933fe4b5: Pushed v1: digest: sha256:49e8a4db750fe9deff8977c9ded56249d79dfbd292dc42140137e6e2aea04770 size: 1159
|