ICode9

精准搜索请尝试: 精确搜索
首页 > 其他分享> 文章详细

docker企业级镜像仓库harbor搭建

2021-12-19 10:04:00  阅读:359  来源: 互联网

标签:... harbor 企业级 file docker configuration config clair


1. 下载harbor离线安装包

harbor下载地址

wget https://github.com/goharbor/harbor/releases/download/v1.10.9/harbor-offline-installer-v1.10.9.tgz

2. 解压harbor安装包

tar xvf harbor-offline-installer-v1.10.9.tgz -C /usr/local/

在这里插入图片描述

3. 编辑harbor配置文件

vim /usr/local/harbor/harbor.yml

在这里插入图片描述

4. 编辑docker配置文件

vim /etc/docker/daemon.json

{
             "registry-mirrors": [
                              "http://f1361db2.m.daocloud.io","https://6drkwgha.mirror.aliyuncs.com"
                                   ],
             "insecure-registries":["192.168.227.57:5000","192.168.227.57:80"]
                                         }

5. 安装docker-compose

curl -L https://get.daocloud.io/docker/compose/releases/download/1.29.2/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose

6. 运行安装脚本

/usr/local/harbor/install.sh  --with-clair --with-chartmuseum
[root@localhost harbor]# /usr/local/harbor/install.sh  --with-clair --with-chartmuseum

[Step 0]: checking if docker is installed ...

Note: docker version: 20.10.12

[Step 1]: checking docker-compose is installed ...

Note: docker-compose version: 1.29.2

[Step 2]: loading Harbor images ...
Loaded image: goharbor/harbor-core:v1.10.9
Loaded image: goharbor/harbor-jobservice:v1.10.9
Loaded image: goharbor/notary-signer-photon:v1.10.9
Loaded image: goharbor/nginx-photon:v1.10.9
Loaded image: goharbor/chartmuseum-photon:v1.10.9
Loaded image: goharbor/registry-photon:v1.10.9
Loaded image: goharbor/clair-photon:v1.10.9
Loaded image: goharbor/clair-adapter-photon:v1.10.9
Loaded image: goharbor/prepare:v1.10.9
Loaded image: goharbor/harbor-portal:v1.10.9
Loaded image: goharbor/harbor-db:v1.10.9
Loaded image: goharbor/notary-server-photon:v1.10.9
Loaded image: goharbor/harbor-log:v1.10.9
Loaded image: goharbor/harbor-registryctl:v1.10.9
Loaded image: goharbor/redis-photon:v1.10.9


[Step 3]: preparing environment ...

[Step 4]: preparing harbor configs ...
prepare base dir is set to /usr/local/harbor
/usr/src/app/utils/configs.py:100: YAMLLoadWarning: calling yaml.load() without Loader=... is deprecated, as the default Loader is unsafe. Please read https://msg.pyyaml.org/load for full details.
  configs = yaml.load(f)
WARNING:root:WARNING: HTTP protocol is insecure. Harbor will deprecate http protocol in the future. Please make sure to upgrade to https
/usr/src/app/utils/configs.py:90: YAMLLoadWarning: calling yaml.load() without Loader=... is deprecated, as the default Loader is unsafe. Please read https://msg.pyyaml.org/load for full details.
  versions = yaml.load(f)
Clearing the configuration file: /config/log/logrotate.conf
Clearing the configuration file: /config/log/rsyslog_docker.conf
Clearing the configuration file: /config/nginx/nginx.conf
Clearing the configuration file: /config/core/env
Clearing the configuration file: /config/core/app.conf
Clearing the configuration file: /config/registry/config.yml
Clearing the configuration file: /config/registryctl/env
Clearing the configuration file: /config/registryctl/config.yml
Clearing the configuration file: /config/db/env
Clearing the configuration file: /config/jobservice/env
Clearing the configuration file: /config/jobservice/config.yml
Clearing the configuration file: /config/clair/postgresql-init.d/README.md
Clearing the configuration file: /config/clair/postgres_env
Clearing the configuration file: /config/clair/config.yaml
Clearing the configuration file: /config/clair/clair_env
Clearing the configuration file: /config/clair-adapter/env
Clearing the configuration file: /config/chartserver/env
Generated configuration file: /config/log/logrotate.conf
Generated configuration file: /config/log/rsyslog_docker.conf
Generated configuration file: /config/nginx/nginx.conf
Generated configuration file: /config/core/env
Generated configuration file: /config/core/app.conf
Generated configuration file: /config/registry/config.yml
Generated configuration file: /config/registryctl/env
Generated configuration file: /config/db/env
Generated configuration file: /config/jobservice/env
Generated configuration file: /config/jobservice/config.yml
loaded secret from file: /secret/keys/secretkey
Copying offline data file for clair DB
Generated configuration file: /config/clair/postgres_env
Generated configuration file: /config/clair/config.yaml
Generated configuration file: /config/clair/clair_env
Generated configuration file: /config/clair-adapter/env
Generated configuration file: /config/chartserver/env
Generated configuration file: /compose_location/docker-compose.yml
Clean up the input dir



[Step 5]: starting Harbor ...
Creating harbor-log ... done
Creating harbor-db     ... done
Creating redis         ... done
Creating registry      ... done
Creating harbor-portal ... done
Creating chartmuseum   ... done
Creating registryctl   ... done
Creating clair         ... done
Creating harbor-core   ... done
Creating clair-adapter ... done
Creating harbor-jobservice ... done
Creating nginx             ... done
✔ ----Harbor has been installed and started successfully.----

7. 访问harbor网页端

访问地址:http://192.168.227.57/harbor
默认管理员admin ;密码 Harbor12345

在这里插入图片描述

8. 登录harbor

docker login 192.168.227.57:80
默认管理员admin ;密码 Harbor12345

在这里插入图片描述

9. 推送docker镜像到harbor

[root@localhost harbor]# docker tag de764ad211de 192.168.227.57:80/db/mysql:8.0.16
[root@localhost harbor]# docker push 192.168.227.57:80/db/mysql:8.0.16
The push refers to repository [192.168.227.57:80/db/mysql]
605d208195c7: Pushed 
9d87c3455758: Pushed 
80f1020054a4: Pushed 
b0425df45fae: Pushed 
680666c6bf72: Pushed 
7e7fffcdabb3: Pushed 
77737de99484: Pushed 
2f1b41b24201: Pushed 
007a7f930352: Pushed 
c6926fcee191: Pushed 
b78ec9586b34: Pushed 
d56055da3352: Pushed 
8.0.16: digest: sha256:036b8908469edac85afba3b672eb7cbc58d6d6b90c70df0bb3fe2ab4fd939b22 size: 2828

看看从本地推送到harbor的镜像
在这里插入图片描述

标签:...,harbor,企业级,file,docker,configuration,config,clair
来源: https://blog.csdn.net/u010080562/article/details/122018634

本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享;
2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关;
3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关;
4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除;
5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有