http 协议 harbor 镜像仓库部署
 作者:忙着长大#
- 2022-10-30  广东
 本文字数:1755 字
阅读完需:约 6 分钟
解压 harbor 部署包,并修改配置文件
root@yt:~/harbor# tar -xf harbor-offline-installer-v2.6.1.tgz root@yt:~/harbor# lsharbor  harbor-offline-installer-v2.6.1.tgzroot@yt:~/harbor# cd harbor/root@yt:~/harbor/harbor# lscommon.sh  harbor.v2.6.1.tar.gz  harbor.yml.tmpl  install.sh  LICENSE  prepareroot@yt:~/harbor/harbor# cp harbor.yml.tmpl  harbor.yml
## 修改harbor的配置文件,只要修改访问域名(改为本机ip即可)和https(将https那段全都注释掉)。# hostname: 192.168.131.129  harbor_admin_password: Aa123456   主要是这两个配置需要修改root@yt:~/harbor/harbor# vim harbor.ymlroot@yt:~/harbor/harbor# ./install.sh  --with-trivy --with-chartmuseum## 开始安装harborroot@yt:~/harbor/harbor# docker-compose ps      Name                     Command                  State                      Ports                --------------------------------------------------------------------------------------------------------chartmuseum         ./docker-entrypoint.sh           Up (healthy)                                       harbor-core         /harbor/entrypoint.sh            Up (healthy)                                       harbor-db           /docker-entrypoint.sh 96 13      Up (healthy)                                       harbor-jobservice   /harbor/entrypoint.sh            Up (healthy)                                       harbor-log          /bin/sh -c /usr/local/bin/ ...   Up (healthy)   127.0.0.1:1514->10514/tcp           harbor-portal       nginx -g daemon off;             Up (healthy)                                       nginx               nginx -g daemon off;             Up (healthy)   0.0.0.0:80->8080/tcp,:::80->8080/tcpredis               redis-server /etc/redis.conf     Up (healthy)                                       registry            /home/harbor/entrypoint.sh       Up (healthy)                                       registryctl         /home/harbor/start.sh            Up (healthy)                                       trivy-adapter       /home/scanner/entrypoint.sh      Up (healthy)        复制代码
 docker 使用 harbor 仓库需要增加配置
{  "registry-mirrors": ["https://hccwwfjl.mirror.aliyuncs.com","http://hub-mirror.c.163.com"],    ## 主要是增加下面一条配置  "insecure-registries": ["192.168.131.129"],      "exec-opts": ["native.cgroupdriver=systemd"],  "log-driver": "json-file",  "log-opts": {    "max-size": "100m"  },  "storage-driver": "overlay2"}
修改完配置,重启dockerroot@yt:~/harbor/harbor# systemctl daemon-reload root@yt:~/harbor/harbor# systemctl restart docker复制代码
 登录 harbor 仓库
root@yt:~/harbor/harbor# docker login 192.168.131.129Username: admin   Password: WARNING! Your password will be stored unencrypted in /root/.docker/config.json.Configure a credential helper to remove this warning. Seehttps://docs.docker.com/engine/reference/commandline/login/#credentials-store
Login Succeeded复制代码
 将镜像重新打 tag 然后推送到 harbor 仓库,推送成功
root@yt:~/harbor/harbor# docker tag local/ubuntu-nginx:v3 192.168.131.129/local/ubuntu-nginx:v3root@yt:~/harbor/harbor# docker push 192.168.131.129/local/ubuntu-nginx:v3The push refers to repository [192.168.131.129/local/ubuntu-nginx]8fc343974b33: Pushed c5176323da43: Pushed 3cba2a74e87d: Pushed 84d9c024b813: Pushed 0a1e129c1f97: Pushed 05e4efb5c598: Pushed 52191bb627ec: Pushed ff5806440e8b: Pushed e33117606e4a: Pushed 950d1cd21157: Pushed v3: digest: sha256:549c52aef5e82e68697653d238ab4e082499dea8ecfe1e078a34960000e9b04f size: 2414root@yt:~/harbor/harbor# 复制代码
 可以看到 harbor 中已经有了镜像
 划线
评论
复制
发布于: 刚刚阅读数: 3
忙着长大#
关注
还未添加个人签名 2022-02-09 加入
还未添加个人简介









    
评论