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
本文由Bypass整理发布,转载请保留出处。
欢迎关注我的个人微信公众号:Bypass--,浏览更多精彩文章。
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· DeepSeek 开源周回顾「GitHub 热点速览」
· 物流快递公司核心技术能力-地址解析分单基础技术分享
· .NET 10首个预览版发布:重大改进与新特性概览!
· AI与.NET技术实操系列(二):开始使用ML.NET
· 单线程的Redis速度为什么快?
2018-06-14 Apache安全配置基线指导
2017-06-14 FTP匿名访问修复方法