推送镜像/登录失败(Error response from daemon: Get https://reg.harbor.com/v2/: dial tcp 192…)

搭建好Harbor之后,使用docker登录仓库,或者推送镜像到仓库时被拒绝。

[root@kube-node-1 harbor]# docker login reg.harbor.com
Authenticating with existing credentials...
Login did not succeed, error: Error response from daemon: Get https://reg.harbor.com/v2/: dial tcp 192.168.186.21:443: connect: connection refused
[root@kube-node-1 harbor]# docker push reg.harbor.com/harbor-test/nginx-offica
The push refers to repository [reg.harbor.com/harbor-test/nginx-offica]
Get https://reg.harbor.com/v2/: dial tcp 192.168.186.21:443: connect: connection refused

这是因为在使用docker的仓库时,Registry为了安全性考虑,默认是需要https证书支持。除了生成证书,配置https的办法之外,我们在实验环境中,还可以通过修改docker启动文件来解决。

如上图,在docker的启动文件添加--insecure-registry选项,后面可以使用IP或者可以解析的域名。
添加好之后,重新启动docker服务:

[root@kube-node-1 harbor]# systemctl daemon-reload
[root@kube-node-1 harbor]# systemctl restart docker

重启docker之后,可能会遇到Harbor无法正常访问的问题,是因为docker重启后,harbor相关的容器没有完全启动,只要将所有的harbor容器重启即可,最好先启动harbor-log这个容器。

可以使用命令 docker restart containerID逐个重启,也可以使用docker-compose进行重新启动:

[root@kube-node-1 harbor]# docker-compose stop
Stopping nginx             ... done
Stopping harbor-jobservice ... done
Stopping harbor-core       ... done
Stopping registry          ... done
Stopping harbor-portal     ... done
Stopping redis             ... done
Stopping registryctl       ... done
Stopping harbor-db         ... done
Stopping harbor-log        ... done
[root@kube-node-1 harbor]# docker-compose up -d
Starting harbor-log ... done
Starting redis ...
Starting harbor-db ...
Starting registryctl ...
Starting harbor-portal ...
Starting registry ... done
Starting harbor-core ... done
Starting harbor-jobservice ...
Starting nginx ... done

注意:这个启停操作需要在harbor的安装目录下使用,否则会报以下错误

[root@kube-node-1 ~]# docker-compose stop
ERROR:Can't find a suitable configuration file in this directory or anyparent. Are you in the right directory?Supported filenames: docker-compose.yml, docker-compose.yaml

重新登录

[root@kube-node-1 harbor]# docker login reg.harbor.com:80
Username: admin
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-storeLogin Succeeded

重新打包镜像并推送

[root@kube-node-1 harbor]# docker tag nginx:latest reg.harbor.com:80/harbor-test/nginx-offical
[root@kube-node-1 harbor]# docker push reg.harbor.com:80/harbor-test/nginx-offical
The push refers to repository [reg.harbor.com:80/harbor-test/nginx-offical]
85fcec7ef3ef: Pushed
3e5288f7a70f: Pushed
56bc37de0858: Pushed
1c91bf69a08b: Pushed
cb42413394c4: Pushed
latest: digest: sha256:0b159cd1ee1203dad901967ac55eee18c24da84ba3be384690304be93538bea8 size: 1362

推送成功

Docker-Harbor:推送镜像/登录失败(Error response from daemon: Get https://reg.harbor.com/v2/: dial tcp 192...)相关推荐

  1. docker 删除镜像时报错Error response from daemon: conflict: unable to delete xxx (must be forced) -

    解决方法 方法一:删除时不要使用 image ID,改用镜像名称(REPOSITORY) 方法二:docker rmi -f imageID 问题解析 docker rmi 8e6aee9da407 ...

  2. Docker镜像报错:Error response from daemon: Get https://registry-1.docker.io/v2/: net/http: request cance

    root@mlt-bddl08:~# docker pull ubuntu:18.04 Error response from daemon: Get https://registry-1.docke ...

  3. Docker 报错Error response from daemon: Get https://xx.xx.xx.xx/v2/: Service Unavailable

    问题 Mac 上docker pull是报错Error response from daemon: Get https://xx.xx.xx.xx/v2/: Service Unavailable 执 ...

  4. 已解决:Error response from daemon: Get https://registry-1.docker.io/v2/: net/http: TLS handshaketimeout

    1.问题描述 下载rancher/mirrored-flannelcni-flannel-cni-plugin:v1.0.0镜像报以下错误: Error response from daemon: G ...

  5. 解决:Error response from daemon: Get https://index.docker.io/v1/search?q=openjdkn=25: dial tcp: looku

    前些天发现了一个巨牛的人工智能学习网站,通俗易懂,风趣幽默,忍不住分享一下给大家.点击跳转到教程. 1. 我只是想查一个 mysql 镜像.执行命令: docker   search   mysql  ...

  6. docker: Error response from daemon: Get https://registry-1.docker.io/v2/: net/http: TLS handshake ti

    docker: Error response from daemon: Get https://registry-1.docker.io/v2/: net/http: TLS handshake ti ...

  7. mac上docker pull是报错Error response from daemon: Get https://xx.xx.xx.xx/v2/: Service Unavailable

    执行docker pull xx.xx.xx.xx/xx/xx,下载私有库的镜像时报错如下: Error response from daemon: Get https://xx.xx.xx.xx/v ...

  8. 修改docker-仓库资源地址Error response from daemon: Get https://index.docker.io/v1/search

    [root@zengmg /]# docker search centos Error response from daemon: Get https://index.docker.io/v1/sea ...

  9. Docker : Error response from daemon: Get https://docker.elastic.co/v2/: net/http: TLS handshake time

    1.美图 2.概述 (base) lcc@lcc ~$ docker pull docker.elastic.co/elasticsearch/elasticsearch:6.3.2 Error re ...

  10. Error response from daemon: Get “https://registry-1.docker.io/v2/“: Service Unavailable

    problem: Error response from daemon: Get "https://registry-1.docker.io/v2/": Service Unava ...

最新文章

  1. 【LIBSVM中的 SVMcgForClass提示不存在的解决方法】
  2. C++析构函数执行顺序
  3. 灯泡亮度控制单片机_如何有效保护投影机灯泡 保护投影机灯泡方法【详解】...
  4. Chapter 1: 使用引用类型
  5. android studio2.3.6,Android Studio 2.3 问题汇总 - 解决一切障碍,为了更好的时代
  6. 《终身成长》卡罗尔 德韦克_epub+mobi+azw3
  7. 使用DebenuPDFLibrary导出微信中的照片
  8. sqlite3 error: database is locked
  9. SQL Server 由于一个或多个对象访问此列,ALTER TABLE DROP COLUMN xxx 失败问题解决
  10. pdman 创建表同步数据库_PDMan-2.0 正式发布:用心开源,免费的国产数据库建模工具PowerDesigner...
  11. Java判断某天是这一年的第几天
  12. Adobe系列软件彻底清理方法(手动删除)
  13. c++逆天改命进阶--map_set
  14. Leetcode1859:将句子排序
  15. 多人网络游戏服务器开发基础学习笔记 I:基本知识 | 游戏设计模式 | 网游服务器层次结构 | 游戏对象序列化 | 游戏 RPC 框架 | 帧同步和状态同步
  16. 魔百盒cm211-1_ZG-晶晨S905和CH-晶晨S905L3B线刷-刷机固件及教程
  17. 《数字语音处理》- 实验4. 基于MATLAB与VQ的特定人孤立词语音识别研究(附代码)
  18. 电脑连不上网显示dns服务器不可用,电脑连不上网疑难解答显示DNS服务器可能不可用该怎么办...
  19. 微信小程序多点定位marker标点polyline连线
  20. unity 鼠标放置 ui_ui层次结构以及不常见但至关重要的任务放置在哪里

热门文章

  1. 技术领导者空降后,如何管理全新的团队
  2. IAR 开发Zigbee 下载调试时总是出现target selection对话框
  3. 利用ACC控制酷狗音乐
  4. 关于职称评审的一些见解
  5. BTA | CSDN蒋涛:区块链时代最大赢家,将属于技术、经济、组织的三合一高手
  6. WICC | 为什么说中国「泛娱乐」出海绕不开这家公司
  7. premiere(Pr)为视频配字幕 开放式字幕使用详解
  8. 远程计算机桌面图标不见了怎么办,网络连接图标不见了原因有哪些【解决方法】...
  9. MATLAB线性回归
  10. 密钥文件snk 、AssemblyInfo.cs