Habor 搭建镜像仓库

 01、环境准备

 (1)安装docker和docker-compose

 (2)下载harbor离线安装包

   下载地址:https://github.com/goharbor/harbor/releases

02、安装harbor

(1)修改配置 

cp harbor.yml.tmpl harbor.yml
#按需要修改配置文件

(2)运行脚本

./prepare
./install.sh

(3)访问harbor

 (4)客户端添加insecure-registary配置

vim  /etc/docker/daemon.json 
{
 "registry-mirrors": ["https://kd88kykb.mirror.aliyuncs.com"],
  #"insecure-registries": ["192.168.93.31:80"]
  "insecure-registries": ["harbor.xxx.com"]
}

(5)命令行登录harbor

[root@harbor ~]# docker login harbor.xxx.com
Authenticating with existing credentials...
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

(6)镜像推送操作

docker tag mysql:5.7  harbor.xxx.com/test/mysql:5.7
docker push harbor.xxx.com/test/mysql:5.7
docker pull harbor.xxx.com/test/mysql:5.7

 

03、问题处理

使用ip端口登录报错信息:

[root@local admin]#  docker login 192.168.91.31:80
Username: admin
Password: 
Error response from daemon: Get https://192.168.91.31:80/v2/: dial tcp 192.168.91.31:80: connect: connection refused

解决方式:

docker-compose down -v
find / -name docker.service -type f
vim /usr/lib/systemd/system/docker.service
    ExecStart=/usr/bin/dockerd -H fd:// --insecure-registry=192.168.93.31 --containerd=/run/containerd/containerd.sock #增加--insecure-registry
systemctl daemon-reload &&systemctl restart docker
docker-compose up -d
ps -aux | grep docker

登录成功:

[root@local harbor]# docker login 192.168.93.31
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

 

 

 

参考链接:

https://blog.51cto.com/u_15266039/2895998

 https://blog.csdn.net/SHELLCODE_8BIT/article/details/125356015

posted @   Bypass  阅读(119)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· DeepSeek 开源周回顾「GitHub 热点速览」
· 物流快递公司核心技术能力-地址解析分单基础技术分享
· .NET 10首个预览版发布:重大改进与新特性概览!
· AI与.NET技术实操系列(二):开始使用ML.NET
· 单线程的Redis速度为什么快?
历史上的今天:
2018-06-14 Apache安全配置基线指导
2017-06-14 FTP匿名访问修复方法
点击右上角即可分享
微信分享提示