Docker login Harbor报错解决:Error response from daemon: Get https:..

简介: Docker login Harbor报错解决:Error response from daemon: Get https:..

报错信息:

[root@localhost harbor]# docker login 192.168.2.195
Username: admin
Password: 
Error response from daemon: Get https://192.168.2.195/v2/: 
dial tcp 192.168.2.195:443: connect: connection refused

查看Docker版本:

[root@localhost ~]# docker version
Client: Docker Engine - Community
 Version:           19.03.8
 API version:       1.40
 Go version:        go1.12.17
 Git commit:        afacb8b
 Built:             Wed Mar 11 01:27:04 2020
 OS/Arch:           linux/amd64
 Experimental:      false
Server: Docker Engine - Community
 Engine:
  Version:          19.03.8
  API version:      1.40 (minimum version 1.12)
  Go version:       go1.12.17
  Git commit:       afacb8b
  Built:            Wed Mar 11 01:25:42 2020
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          1.2.13
  GitCommit:        7ad184331fa3e55e52b890ea95e65ba581ae3429
 runc:
  Version:          1.0.0-rc10
  GitCommit:        dc9208a3303feef5b3839f4323d9beb36df0a9dd
 docker-init:
  Version:          0.18.0
  GitCommit:        fec3683

停止harbor:


 docker-compose down -v:停止并移除整个project的所有services

[root@localhost harbor]# docker-compose down -v
Stopping harbor-jobservice  ... done
Stopping nginx              ... done
Stopping harbor-ui          ... done
Stopping redis              ... done

查找docker.service所在位置:

[root@localhost harbor]# find / -name docker.service -type f
/usr/lib/systemd/system/docker.service

修改docker.service配置文件:


 添加 --insecure-registry=192.168.2.195 配置

[root@localhost harbor]# vim /usr/lib/systemd/system/docker.service
[Unit]
Documentation=http://docs.docker.io     //需修改
...
[Service]
Type=notify
# the default is not to use systemd for cgroups because the delegate issues still
# exists and systemd currently does not support the cgroup feature set required
# for containers run by docker
# ExecStart=/usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock
ExecStart=/usr/bin/dockerd --insecure-registry=192.168.2.195   //重要
ExecStartPost=/sbin/iptables -I FORWARD -s 0.0.0.0/0 -j ACCEPT
      //需修改,根据自己的docker路径跟IP地址进行修改
ExecReload=/bin/kill -s HUP $MAINPID
TimeoutSec=0
RestartSec=2
Restart=always
...
[Install]
WantedBy=multi-user.target

重启服务:

[root@localhost harbor]# systemctl daemon-reload
[root@localhost harbor]# systemctl restart docker

启动harbor:


 docker-compose up -d    :构建(容器)并启动(容器)整个project的所有service

[root@localhost harbor]# docker-compose up -d
Creating network "harbor_harbor" with the default driver
Creating harbor-log ... done
Creating registry           ... done
Creating redis              ... done
Creating harbor-db          ... done
Creating harbor-adminserver ... done
Creating harbor-ui          ... done
Creating nginx              ... done
Creating harbor-jobservice  ... done

查看服务:


 已经包含了 --insecure-registry=192.168.2.195 参数

[root@localhost harbor]# ps -aux | grep docker
...
root      40719  1.4  4.8 660304 79992 ?        Ssl  01:58   0:14 /usr/bin/dockerd --insecure-registry=192.168.2.195
...

测试登录:

[root@localhost harbor]# docker login 192.168.2.195
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-store
Login Succeeded        //登录成功

 成功登录!

相关文章
|
2天前
|
运维 Java Devops
阿里云云效操作报错合集之部署docker时遇到报错,该怎么办
本合集将整理呈现用户在使用过程中遇到的报错及其对应的解决办法,包括但不限于账户权限设置错误、项目配置不正确、代码提交冲突、构建任务执行失败、测试环境异常、需求流转阻塞等问题。阿里云云效是一站式企业级研发协同和DevOps平台,为企业提供从需求规划、开发、测试、发布到运维、运营的全流程端到端服务和工具支撑,致力于提升企业的研发效能和创新能力。
|
2天前
|
分布式数据库 流计算 Docker
实时计算 Flink版操作报错合集之在Docker上启动JobManager(JM)时遇到报错,,该怎么处理
在使用实时计算Flink版过程中,可能会遇到各种错误,了解这些错误的原因及解决方法对于高效排错至关重要。针对具体问题,查看Flink的日志是关键,它们通常会提供更详细的错误信息和堆栈跟踪,有助于定位问题。此外,Flink社区文档和官方论坛也是寻求帮助的好去处。以下是一些常见的操作报错及其可能的原因与解决策略。
|
2天前
|
弹性计算 Java Maven
阿里云云效操作报错合集之在构建Docker镜像时提示拉取次数达到限制,该怎么解决
本合集将整理呈现用户在使用过程中遇到的报错及其对应的解决办法,包括但不限于账户权限设置错误、项目配置不正确、代码提交冲突、构建任务执行失败、测试环境异常、需求流转阻塞等问题。阿里云云效是一站式企业级研发协同和DevOps平台,为企业提供从需求规划、开发、测试、发布到运维、运营的全流程端到端服务和工具支撑,致力于提升企业的研发效能和创新能力。
|
Kubernetes 应用服务中间件 nginx
镜像仓库docker login不成功的解决方案
容器镜像服务ACR可以方便用户进行镜像全生命周期管理。本文给出了阿里云容器服务K8S对ACR 在docker login不成功时的解决方法。
1400 0
镜像仓库docker login不成功的解决方案
|
1天前
|
Shell 调度 Docker
在Docker中,如何清理批量后台停止的容器?
在Docker中,如何清理批量后台停止的容器?
|
1天前
|
存储 Ubuntu 应用服务中间件
在Docker中,怎么快速查看本地的镜像和容器?
在Docker中,怎么快速查看本地的镜像和容器?
|
1天前
|
存储 Docker 容器
在Docker中,容器退出后,通过docker ps命令查看不到,数据会丢失么?
在Docker中,容器退出后,通过docker ps命令查看不到,数据会丢失么?
|
1天前
|
缓存 Kubernetes 数据中心
在Docker中,如何控制容器占用系统资源(CPU,内存)的份额?
在Docker中,如何控制容器占用系统资源(CPU,内存)的份额?
|
1天前
|
Kubernetes Shell 测试技术
在Docker中,可以在一个容器中同时运行多个应用进程吗?
在Docker中,可以在一个容器中同时运行多个应用进程吗?
|
1天前
|
Shell Docker 容器
在Docker中,如何停止所有正在运行的容器?
在Docker中,如何停止所有正在运行的容器?