Skip to content

安装Harbor

https://github.com/goharbor/harbor/releases 选择Harbor offline installer下载离线包,解压

common/
docker-compose.yml
harbor.v1.8.2.tar.gz
harbor.yml              配置文件 
install.sh*             启动
LICENSE
prepare*

通过 ./install.sh 启动

docker tag nginx:latest 192.168.0.237:8088/pocket/nginx:latest

docker login 192.168.0.237:8088 -u mireal -p Aa1234432

docker push 192.168.0.237:8088/pocket/nginx:latest

关于docker login登录不上的问题

root@ubuntu:/etc/docker# docker login 192.168.0.237:8088
Username: admin
Password: 
Error response from daemon: Get https://192.168.0.237:8088/v2/: http: server gave HTTP response to HTTPS client

解决:

====================================================

  • 添加 insecure-registries,命令 vim /etc/docker/daemon.json
json
{
  "registry-mirrors": [
    "https://tnxkcso1.mirror.aliyuncs.com/"
  ],
  "insecure-registries": [
    "192.168.0.237:8088"
  ]
}
  • 修改docker客户端配置vim /etc/default/docker
OPTIONS='--selinux-enabled --log-driver=journald --signature-verification=false --insecure-registry=192.168.0.237:8088'

备注:增加harbor私有仓库地址,告知客户端要连接http的端口

  • 重启docker服务
sudo systemctl daemon-reload

sudo systemctl restart docker
  • 重新进行登录尝试
root@ubuntu:/usr/local/docker/harbor# docker login 192.168.0.237:8088
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

关于 error storing credentials - err: exit status 1, out: `Failed to execute child process “dbus-launch”

参考:https://www.iteye.com/blog/sillycat-2437414

root@ubuntu:~# docker login 192.168.0.237:8088
Username: admin
Password: 
Error saving credentials: error storing credentials - err: exit status 1, out: `Failed to execute child process “dbus-launch” (No such file or directory)`
  • 解决办法
sudo apt install gnupg2 pass

文章来源于自己总结和网络转载,内容如有任何问题,请大佬斧正!联系我