当前位置: 首页 > news >正文

Ubuntu安装harbor(http模式)并随便上传一个

Ubuntu安装harbor(http模式)

docker和harbor的介绍就免了,都不知道啥东西,还安装搞毛

先安装docker环境

不要问,软件源之类的配置,挨个梭就行

sudo apt update
sudo apt install apt-transport-https ca-certificates curl gnupg-agent software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository “deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable”

必要梭哈的搞完了正式安装docker

sudo apt update
sudo apt install docker-ce docker-ce-cli containerd.io

验证是否正常

sudo systemctl status docker

显示

安装harbor

github选版本下载
下载的tgz文件放到/usr/local,解压

cd /usr/local
tar -xvf harbor-offline-installer-v2.8.3.tgz
cd harbor
cp harbor.yml.tmpl harbor.yml #复制一份修改,万一发生万一了,有个复原的
vim harbor.yml

在这里插入图片描述
80端口容易冲突,有个nginx什么的,但是80端口好用啊
Https搞不明白的,建议注释掉,写博客的时候我已经注释了
蓝色的是默认密码,记一下就行,不用改
保存退出,执行安装指令

sudo ./install.sh

在这里插入图片描述
打开浏览器访问地址http://ip:port/harbor,我的本机不加/harbor老是跳转到https
admin/Harbor12345
登录

上传一个镜像

登录到harbor的管理系统后,在项目选择新建项目
在这里插入图片描述

先登录

docker login hostname(harbor.yml配置的那个)

先看一下本地都有些啥镜像

docker images

反正就是为了推一个镜像测试功能,新搞一个helloWorld的镜像上传也行,找个现成的推一下也行
docker images列表,刚刚安装haibor保底有以下的镜像
在这里插入图片描述
用最小的goharbor做示例,添加一个tag

docker tag goharbor/registry-photon:v2.8.2 hostname/test/registry:v1

使用docker images能看到镜像列表多了一行

docker push hostname/test/registry:v1

提示成功后,去harbor管理系统打开test查看

问题和处理

  1. denied: requested access to the resource is denied
    分析: 未登录 或 登录别的地址 或 push的地址不对。
    办法: docker login xxxx(没有这个地址默认登陆到dockerhub了),之前登录成功过,会自动验证通过。harbor默认账密:admin/Harbor12345
    登录是成功的,考虑推送的地址有问题,打开系统,看一下正确的应该是啥格式
    在这里插入图片描述

  1. Error response from daemon: Get “https://xx.xx.xx.xx/v2/”: dial tcp xx.xx.xx.xx:443: connect: connection refused

分析: harbor地址是http的,但是你的docker链接的时候非要用https,导致绿驴唇不对马嘴,
办法: 修改docker.service文件,文件位置:/usr/lib/systemd/system/docker.service docker,不放心的也可以查找一下 find / -name “docker.service”

ExecStart=/usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock

ExecStart=/usr/bin/dockerd --insecure-registry=x.x.x.x #你的harborIP

然后重启一下,如果发现重启报错,删除daemon.json文件的insecure-registries

systemctl daemon-reload && systemctl restart docker


  1. Error response from daemon: Get https://xxxx.xxxx.xxx/v2/: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)
    分析: 系统不认识你的域名,解析蒙了
    办法: 修改/etc/hosts 添加一行

x.x.x.x yyy.com


  1. read tcp read: connection reset by peer
    没记住是啥原因,没方向瞎折腾的时候出现过,来来回回忘了怎么解决的了
http://www.lryc.cn/news/105526.html

相关文章:

  • 《向量数据库指南》——腾讯云向量数据库Tencent Cloud Vector DB正式上线公测!提供10亿级向量检索能力
  • 1分钟解决github push/pull报错443
  • vue3学习-ref引用
  • Docker 容器转为镜像
  • 阿里云服务器免费试用及搭建WordPress网站
  • 整流二极管型号汇总,超齐全
  • MongoDB 操作命令
  • markdown高级写作技巧汇总
  • SpringBoot自动配置原理入门级理解
  • 2023 08.02 小记与展望
  • MaxPatrol SIEM 增加了一套检测供应链攻击的专业技术
  • 蓝桥杯上岸每日N题 第六期(求阶乘)!!!
  • Codeforces Round 889 (Div. 2)(视频讲解A——D)
  • K8s安全配置:CIS基准与kube-bench工具
  • linux安装python和部署Django项目
  • 00-Hadoop入门
  • SE-Net注意力机制详解
  • 商城免费搭建之java商城 开源java电子商务Spring Cloud+Spring Boot+mybatis+MQ+VR全景+b2b2c bbc
  • 推理加速 --- torch.compile
  • JS-----数据结构与算法(2)
  • 手把手安装TomCat;并部署JPress
  • tensorflow1.13分布式训练 参考资料 -教程原理
  • DP学习第五篇之礼物的最大价值
  • cURL error 1: Protocol “https“ not supported or disabled in libcurl
  • XCode升级后QT无法编译的问题
  • springboot编写mp4视频播放接口
  • 华为OD机试真题 JavaScript 实现【机器人活动区域】【2023Q1 200分】,附详细解题思路
  • C++中的静态分配和动态分配
  • 【Android常见问题(五)】- Flutter项目性能优化
  • JSON转换:实体类和JSONObject互转,List和JSONArray互转(fastjson版)