当前位置:   article > 正文

harbor离线安装_habor received unexpected http status: 500 interna

habor received unexpected http status: 500 internal server error

1、介绍

Docker容器应用的开发和运行离不开可靠的镜像管理,虽然Docker官方也提供了公共的镜像仓库,但是从安全和效率等方面考虑,部署我们私有环境内的Registry也是非常必要的。Harbor是由VMware公司开源的企业级的Docker Registry管理项目,它包括权限管理(RBAC)、LDAP、日志审核、管理界面、自我注册、镜像复制和中文支持等功能。

2、下载地址:

   https://github.com/goharbor/harbor/releases

sudo tar -xvf harbor-offline-installer-v1.9.3.tgz

解压后目录 

 

3、修改配置:

修改配置文件harbor.yml

hostname: 192.168.124.128 (自己本机地址)

port: 1180 (自己定义端口号,记得不要使用80端口)

 harbor_admin_password: 12345 (admin进入密码)

4、启动程序

第一步:启动准备文件,使用root权限运行,免得权限不够。

sudo ./prepare

第二步启动安装程序

 sudo ./install.sh

启动成功显示如下: 

5、访问页面

http://192.168.124.128:1180 (使用改地址访问) ,密码:12345,之前配置的。

6、新建项目:

 

 7、上传本地镜像到项目测试:

第一步:创建镜像tag。

docker tag mysql:5.7 192.168.124.128:1180/library/mysql:5.7

第二步:上传镜像

docker push 192.168.124.128:1180/library/mysql:5.7

 遇到问题:

(1):An image does not exist locally with the tag

  1. wxp@ubuntu-128://etc/docker$ docker push 192.168.124.128:1180/gogbee_dev/jenkinsci/blueocean
  2. The push refers to repository [192.168.124.128:1180/gogbee_dev/jenkinsci/blueocean]
  3. An image does not exist locally with the tag: 192.168.124.128:1180/gogbee_dev/jenkinsci/blueocean

 解决办法,执行以下命令,创建标签:

docker tag jenkinsci/blueocean 192.168.124.128:1180/library/jenkinsci/blueocean

(2):http: server gave HTTP response to HTTPS client

  1. wxp@ubuntu-129:~$ docker push 192.168.124.128:1180/library/graylog/graylog:3.0
  2. Error response from daemon: Get https://192.168.124.128:1180/v2/: http: server gave HTTP response to HTTPS client
 

解决办法:

cd /etc/docker/

修改daemon.json

  1. {
  2.            "insecure-registries":["192.168.124.128:1180"]
  3.   }

192.168.124.128:1180:ip和端口就是harbor配置的端口和ip。

重启docker 服务。

systemctl restart docker

(3):denied: requested access to the resource is denied (请求受到拒绝。)

  1. wxp@ubuntu-128://etc/docker$ docker push 192.168.124.128:1180/goharbor/mysql:5.7
  2. The push refers to repository [192.168.124.128:1180/goharbor/mysql]
  3. 8129a85b4056: Preparing
  4. 3c376267ac82: Preparing
  5. fa9efdcb088a: Preparing
  6. 9e615ff77b4f: Preparing
  7. e5de8ba20fae: Preparing
  8. 2bee3420217b: Waiting
  9. 904af8e2b2d5: Waiting
  10. daf31ec3573d: Waiting
  11. da4155a7d640: Waiting
  12. 3b7c5f5acc82: Waiting
  13. 295d6a056bfd: Waiting
  14. denied: requested access to the resource is denied

解决办法:

使用docker登陆到harbor

  1. wxp@ubuntu-128:/usr/local/share/ca-certificates$ docker login --username=admin 192.168.124.128:1180
  2. Password:

 --username=admin :harbor登录用户。

Password: 12345 (harbor设置密码。)

(4):Error saving credentials: error storing credentials - err: exit status 1, out: `Cannot create an item in a locked collection`

登录时报错,造成原因:是Ubuntu软件包的一个错误。

sudo apt-get remove golang-docker-credential-helpers

 然后正常登录,这样就能推送成功,这样大功告成。

  1. wxp@ubuntu-128:/usr/local/share/ca-certificates$ docker push 192.168.124.128:1180/library/mysql:5.7
  2. The push refers to repository [192.168.124.128:1180/library/mysql]
  3. 8129a85b4056: Pushed
  4. 3c376267ac82: Pushed
  5. fa9efdcb088a: Pushed
  6. 9e615ff77b4f: Pushed
  7. e5de8ba20fae: Pushed
  8. 2bee3420217b: Pushed
  9. 904af8e2b2d5: Pushed
  10. daf31ec3573d: Pushed
  11. da4155a7d640: Pushed
  12. 3b7c5f5acc82: Pushed
  13. 295d6a056bfd: Pushed
  14. 5.7: digest: sha256:c0806ac73235043de2a6cb4738bb2f6a74f71d9c7aa0f19c8e7530fd6c299e75 size: 2617

查看harbor如下:

(5)received unexpected HTTP status: 500 Internal Server Error

df -h 

查看磁盘信息,因为磁盘满了,导致没法上传镜像。 

 终于大功告成。

声明:本文内容由网友自发贡献,转载请注明出处:【wpsshop博客】
推荐阅读
相关标签
  

闽ICP备14008679号