Docker安装Harbor

这篇具有很好参考价值的文章主要介绍了Docker安装Harbor。希望对大家有所帮助。如果存在错误或未考虑完全的地方,请大家不吝赐教,您也可以点击"举报违法"按钮提交疑问。

Docker安装Harbor

将此文章写给我最心爱的女孩

1.安装docker、docker-compose

yum install docker-ce-20.10.9 -y
yum install epel-release -y
yum install docker-compose –y

2.下载Harbor安装包

下载地址
下载会有点慢,建议用迅雷下载
下载的harbor-offline-installer-v1.10.10.tgz 包通过ftp工具拉取到服务器上
docker安装harbor,运维,docker,运维,容器

3.解压安装包

tar zxvf harbor-offline-installer-v1.10.10.tgz 

显示

[root@localhost harbor]# tar zxvf harbor-offline-installer-v1.10.10.tgz 
harbor/harbor.v1.10.10.tar.gz
harbor/prepare
harbor/LICENSE
harbor/install.sh
harbor/common.sh
harbor/harbor.yml

解压之后会生成harbor文件夹,cd进去

[root@localhost harbor]# ls
common  common.sh  docker-compose.yml  harbor.v1.10.10.tar.gz  harbor.yml  install.sh  LICENSE  prepare

4.Docker加载harbor镜像

docker load -i harbor.v1.10.10.tar.gz

显示

[root@localhost harbor]# ls
harbor  harbor-offline-installer-v1.10.10.tgz
[root@localhost harbor]# cd harbor
[root@localhost harbor]# ls
common.sh  harbor.v1.10.10.tar.gz  harbor.yml  install.sh  LICENSE  prepare
[root@localhost harbor]# docker load -i harbor.v1.10.10.tar.gz 
454bac8f976d: Loading layer [==================================================>]  34.62MB/34.62MB
babe85b686ad: Loading layer [==================================================>]   11.4MB/11.4MB
259a4c53fb16: Loading layer [==================================================>]  7.697MB/7.697MB
98ac3dea2937: Loading layer [==================================================>]  223.2kB/223.2kB
cdaa2acc770f: Loading layer [==================================================>]  195.1kB/195.1kB
0a48234d6364: Loading layer [==================================================>]  15.36kB/15.36kB
173c8c58ac9c: Loading layer [==================================================>]  3.584kB/3.584kB
Loaded image: goharbor/harbor-portal:v1.10.10
b380398fcbd9: Loading layer [==================================================>]  9.549MB/9.549MB
bc529c783a53: Loading layer [==================================================>]  3.584kB/3.584kB
e9ce0315169d: Loading layer [==================================================>]  3.072kB/3.072kB
67bd603fe25a: Loading layer [==================================================>]  18.95MB/18.95MB
14e24ca9b198: Loading layer [==================================================>]  19.78MB/19.78MB
Loaded image: goharbor/registry-photon:v1.10.10
6230e8094809: Loading layer [==================================================>]  9.549MB/9.549MB
0a9687793924: Loading layer [==================================================>]  12.09MB/12.09MB
82b02208b278: Loading layer [==================================================>]  12.09MB/12.09MB
Loaded image: goharbor/clair-adapter-photon:v1.10.10
facb3a7ee1e6: Loading layer [==================================================>]  9.549MB/9.549MB
81d29f7fac9d: Loading layer [==================================================>]  62.66MB/62.66MB
37883bc38d7c: Loading layer [==================================================>]  3.072kB/3.072kB
8aa48f380871: Loading layer [==================================================>]  3.584kB/3.584kB
c5681a8ef18a: Loading layer [==================================================>]  63.48MB/63.48MB
Loaded image: goharbor/chartmuseum-photon:v1.10.10
56bbc9cc94cf: Loading layer [==================================================>]  9.544MB/9.544MB
a207919569bf: Loading layer [==================================================>]  5.925MB/5.925MB
0a29582a26cd: Loading layer [==================================================>]  13.33MB/13.33MB
1b0a8ff5a816: Loading layer [==================================================>]  26.35MB/26.35MB
6dbcc574c94e: Loading layer [==================================================>]  22.02kB/22.02kB
f166ede0750a: Loading layer [==================================================>]  13.33MB/13.33MB
Loaded image: goharbor/notary-signer-photon:v1.10.10
86aaaa5372f8: Loading layer [==================================================>]  119.8MB/119.8MB
819275c346fd: Loading layer [==================================================>]  48.71MB/48.71MB
ea77710b7898: Loading layer [==================================================>]   2.56kB/2.56kB
ca2a3efc6750: Loading layer [==================================================>]  1.536kB/1.536kB
dfe233b9926d: Loading layer [==================================================>]  155.6kB/155.6kB
c3a75b2ecccd: Loading layer [==================================================>]  1.776MB/1.776MB
Loaded image: goharbor/prepare:v1.10.10
a4ba54e44ac3: Loading layer [==================================================>]  13.31MB/13.31MB
f1e6788f29b8: Loading layer [==================================================>]  35.84MB/35.84MB
e570535efa12: Loading layer [==================================================>]  5.632kB/5.632kB
cecb134ae993: Loading layer [==================================================>]  40.45kB/40.45kB
b1df430d541c: Loading layer [==================================================>]   2.56kB/2.56kB
Loaded image: goharbor/harbor-core:v1.10.10
9d61b49d78e8: Loading layer [==================================================>]  9.549MB/9.549MB
27d61b3545b1: Loading layer [==================================================>]  3.584kB/3.584kB
a2244026b9bc: Loading layer [==================================================>]  18.95MB/18.95MB
03c5dc84f868: Loading layer [==================================================>]  3.072kB/3.072kB
9b69c5c3d773: Loading layer [==================================================>]  7.739MB/7.739MB
edbd121a3ef0: Loading layer [==================================================>]  27.51MB/27.51MB
Loaded image: goharbor/harbor-registryctl:v1.10.10
f11324788e5e: Loading layer [==================================================>]  116.1MB/116.1MB
9594b2b5491a: Loading layer [==================================================>]  3.072kB/3.072kB
51e6f741940c: Loading layer [==================================================>]   59.9kB/59.9kB
4885c950d461: Loading layer [==================================================>]  61.95kB/61.95kB
Loaded image: goharbor/redis-photon:v1.10.10
1eacc09320d3: Loading layer [==================================================>]  75.89MB/75.89MB
a3e3ad0e02b9: Loading layer [==================================================>]  3.584kB/3.584kB
b372494191eb: Loading layer [==================================================>]  3.072kB/3.072kB
1aad5535a60c: Loading layer [==================================================>]   2.56kB/2.56kB
986f9c984b66: Loading layer [==================================================>]  3.072kB/3.072kB
c143cc1290af: Loading layer [==================================================>]  3.584kB/3.584kB
a31a89cc6444: Loading layer [==================================================>]  12.29kB/12.29kB
3e91299418d7: Loading layer [==================================================>]  3.584kB/3.584kB
Loaded image: goharbor/harbor-log:v1.10.10
784f32f21e7f: Loading layer [==================================================>]  65.05MB/65.05MB
53f565435ba3: Loading layer [==================================================>]  91.13MB/91.13MB
2f17e0297083: Loading layer [==================================================>]  5.632kB/5.632kB
43bb299bbeb4: Loading layer [==================================================>]   2.56kB/2.56kB
b3851907b9a7: Loading layer [==================================================>]   2.56kB/2.56kB
e20d492b0d2f: Loading layer [==================================================>]   2.56kB/2.56kB
8593e00e527b: Loading layer [==================================================>]   2.56kB/2.56kB
064073f4d6fa: Loading layer [==================================================>]  10.75kB/10.75kB
Loaded image: goharbor/harbor-db:v1.10.10
3d696a50ec47: Loading layer [==================================================>]  13.31MB/13.31MB
158c565cf55a: Loading layer [==================================================>]  43.21MB/43.21MB
Loaded image: goharbor/harbor-jobservice:v1.10.10
6a7bbce7dc58: Loading layer [==================================================>]  5.925MB/5.925MB
a3ff85fb97ac: Loading layer [==================================================>]  14.86MB/14.86MB
afa213836201: Loading layer [==================================================>]  26.35MB/26.35MB
6b644a4c4d8f: Loading layer [==================================================>]  22.02kB/22.02kB
2832a6621437: Loading layer [==================================================>]  14.86MB/14.86MB
Loaded image: goharbor/notary-server-photon:v1.10.10
883a6e0d9000: Loading layer [==================================================>]   11.4MB/11.4MB
Loaded image: goharbor/nginx-photon:v1.10.10
8d231d997136: Loading layer [==================================================>]  123.1MB/123.1MB
8598b2dba190: Loading layer [==================================================>]  11.97MB/11.97MB
ddbec80c9a88: Loading layer [==================================================>]  3.072kB/3.072kB
0a79796e5549: Loading layer [==================================================>]  49.15kB/49.15kB
63fb85041d48: Loading layer [==================================================>]  3.584kB/3.584kB
6eb19cef8f23: Loading layer [==================================================>]  12.84MB/12.84MB
Loaded image: goharbor/clair-photon:v1.10.10
[root@localhost harbor]# docker images
REPOSITORY                      TAG        IMAGE ID       CREATED         SIZE
goharbor/chartmuseum-photon     v1.10.10   b8add6b726bb   13 months ago   169MB
goharbor/redis-photon           v1.10.10   da80bdfe2937   13 months ago   149MB
goharbor/clair-adapter-photon   v1.10.10   914f98d8a471   13 months ago   67.3MB
goharbor/clair-photon           v1.10.10   ec877cd064a9   13 months ago   178MB
goharbor/notary-server-photon   v1.10.10   90981e58f79f   13 months ago   105MB
goharbor/notary-signer-photon   v1.10.10   e50ee961a9d6   13 months ago   102MB
goharbor/harbor-registryctl     v1.10.10   8cff0f50ad4a   13 months ago   97.3MB
goharbor/registry-photon        v1.10.10   465538cf61bc   13 months ago   81.8MB
goharbor/nginx-photon           v1.10.10   86473ef9ef24   13 months ago   44.9MB
goharbor/harbor-log             v1.10.10   c9cb00a7af3e   13 months ago   108MB
goharbor/harbor-jobservice      v1.10.10   d244473b6165   13 months ago   88.8MB
goharbor/harbor-core            v1.10.10   b3be36cace3a   13 months ago   81.5MB
goharbor/harbor-portal          v1.10.10   1980673cc854   13 months ago   53MB
goharbor/harbor-db              v1.10.10   0c6ce792483e   13 months ago   187MB
goharbor/prepare                v1.10.10   475fb37cdd49   13 months ago   200MB
[root@localhost harbor]# 

5.修改配置文件

[root@localhost harbor]# cd harbor
[root@localhost harbor]# ls
common.sh  harbor.v1.10.10.tar.gz  harbor.yml  install.sh  LICENSE  prepare
[root@localhost harbor]# vim harbor.yml 

docker安装harbor,运维,docker,运维,容器
设置主机名和密码:192.168.85.139 Harbor12345
docker安装harbor,运维,docker,运维,容器
将上面的https:内容都进行注释,否则会出错:ERROR:root:Error: The protocol is https but attribute ssl_cert is not set

6.执行**./prepare && ./install.sh**命令

[root@localhost harbor]# ./prepare 
prepare base dir is set to /home/harbor/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)
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
Generated and saved secret to file: /secret/keys/secretkey
Generated certificate, key file: /secret/core/private_key.pem, cert file: /secret/registry/root.crt
Generated configuration file: /compose_location/docker-compose.yml
Clean up the input dir

[root@localhost harbor]# ./install.sh 

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

Note: docker version: 23.0.1

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

Note: docker-compose version: 1.18.0

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


[Step 3]: preparing environment ...

[Step 4]: preparing harbor configs ...
prepare base dir is set to /home/harbor/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
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
Creating harbor-log ... done
Generated configuration file: /compose_location/docker-compose.yml
Clean up the input dir


Creating registry ... done
Creating harbor-core ... done
Creating network "harbor_harbor" with the default driver
Creating harbor-jobservice ... done
Creating harbor-portal ... 
Creating harbor-db ... 
Creating registryctl ... 
Creating registry ... 
Creating redis ... 
Creating harbor-core ... 
Creating harbor-jobservice ... 
Creating nginx ... 
✔ ----Harbor has been installed and started successfully.----

7.查看相关镜像

[root@localhost harbor]# docker ps
CONTAINER ID   IMAGE                                  COMMAND                   CREATED          STATUS                    PORTS                                   NAMES
1c2c49bcae29   goharbor/nginx-photon:v1.10.10         "nginx -g 'daemon of…"   47 seconds ago   Up 45 seconds (healthy)   0.0.0.0:80->8080/tcp, :::80->8080/tcp   nginx
bce07bf48d57   goharbor/harbor-jobservice:v1.10.10    "/harbor/harbor_jobs…"   47 seconds ago   Up 45 seconds (healthy)                                           harbor-jobservice
43a696210739   goharbor/harbor-core:v1.10.10          "/harbor/harbor_core"     48 seconds ago   Up 46 seconds (healthy)                                           harbor-core
2c460dcf924f   goharbor/registry-photon:v1.10.10      "/home/harbor/entryp…"   50 seconds ago   Up 47 seconds (healthy)   5000/tcp                                registry
8904cb8b36e2   goharbor/redis-photon:v1.10.10         "redis-server /etc/r…"   50 seconds ago   Up 48 seconds (healthy)   6379/tcp                                redis
9b030e10048b   goharbor/harbor-registryctl:v1.10.10   "/home/harbor/start.…"   50 seconds ago   Up 48 seconds (healthy)                                           registryctl
7613eb27e887   goharbor/harbor-db:v1.10.10            "/docker-entrypoint.…"   50 seconds ago   Up 48 seconds (healthy)   5432/tcp                                harbor-db
ab698202e684   goharbor/harbor-portal:v1.10.10        "nginx -g 'daemon of…"   50 seconds ago   Up 47 seconds (healthy)   8080/tcp                                harbor-portal
62496f80be73   goharbor/harbor-log:v1.10.10           "/bin/sh -c /usr/loc…"   52 seconds ago   Up 49 seconds (healthy)   127.0.0.1:1514->10514/tcp               harbor-log
[root@localhost harbor]# 

8.访问测试,浏览器输入ip即可

docker安装harbor,运维,docker,运维,容器
用户名是admin,密码在上面的配置文件里有 Harbor12345文章来源地址https://www.toymoban.com/news/detail-755935.html

到了这里,关于Docker安装Harbor的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处: 如若内容造成侵权/违法违规/事实不符,请点击违法举报进行投诉反馈,一经查实,立即删除!

领支付宝红包 赞助服务器费用

相关文章

  • Docker安装Harbor

    将此文章写给我最心爱的女孩 下载地址 下载会有点慢,建议用迅雷下载 下载的harbor-offline-installer-v1.10.10.tgz 包通过ftp工具拉取到服务器上 显示 解压之后会生成harbor文件夹,cd进去 显示 设置主机名和密码:192.168.85.139 Harbor12345 将上面的https:内容都进行注释,否则会出错:E

    2024年02月04日
    浏览(37)
  • Docker Harbor安装、使用

    harbor是VMware公司开源的企业级docker registry项目。主要是实现为用户去迅速搭建一个docker registry服务。 提供了可视化UI界面,提供了多个项目的镜像权限管理及控制功能。 安装后可以体验下。 Harbor的每个组件都是以Docker 容器的形式构建的,使用docker - compose来对它进行部署。用

    2024年04月17日
    浏览(34)
  • 第七次作业 运维高级 docker容器进级版

    1、使用mysql:5.6和 owncloud 镜像,构建一个个人网盘。 (1)拉取相应镜像 (2)运行mysql:5.6容器 (3)运行owncloud容器 (4)查看并验证 之后在浏览器中输入ipaddress:8080 2、安装搭建私有仓库 Harbor (1)下载好harbor和docker-compose (2)上传到Linux服务器 (3)复制docker-compose并修改权限 (4)解压harbor (

    2024年02月12日
    浏览(54)
  • 【云原生 | Docker 高级篇】11、Docker 私有镜像仓库 Harbor 安装及使用教程

    目录 一、Harbor 介绍 二、Harbor 的优势 三、Harbor 部署安装 3.1 部署环境 3.2 为 Harbor 自签发证书 3.3 安装 Harbor 3.4 设置开机自启 四、Harbor 图像化界面使用说明 4.1 修改本地 hosts 文件 4.2 访问 harbor 4.3 创建项目 五、测试使用 harbor 私有镜像仓库 5.1 修改 docker 配置 5.2 登录 harbor

    2024年01月17日
    浏览(38)
  • K8S自动化运维容器化(Docker)集群程序

    1.什么是K8S K8S全程为Kubernetes,由于K到S直接有8个字母简称为K8S。 版本:目前一般是1.18~1.2.0,后续可能会到1.24-1.26,1.24版本后丢弃了docker(如需要使用需要第三方插件配合),目前最新版本是1.27 官网:https://kubernetes.io GitHub:GitHub - kubernetes/kubernetes: Production-Grade Container Schedul

    2024年02月10日
    浏览(64)
  • docker harbor的安装使用以及镜像上传和拉取

            harbor是一个开源的容器镜像仓库,可用于存储和分发docker镜像。它提供了安全性、标签、注释、审核和访问控制等高级功能。 harbor旨在帮助用户管理和分发docker镜像,并使其更具可信度和可管理性。 下载并安装docker和docker compose,没有下载的可以看这篇文章dock

    2024年01月22日
    浏览(41)
  • K8S:K8S自动化运维容器Docker集群

    (1)K8S全程为Kubernetes,由于K到S直接有8个字母简称为K8S。 (2)版本:目前一般是1.18~1.2.0,后续可能会到1.24-1.26,1.24版本后丢弃了docker(如需要使用需要第三方插件配合),目前最新版本是1.27 (3)官网:https://kubernetes.io GitHub:GitHub - kubernetes/kubernetes: Production-Grade Container S

    2024年02月10日
    浏览(77)
  • K8S:K8S自动化运维容器化(Docker)集群程序

    目录 一、K8S概述 1、什么是K8S 2、为什么要用K8S 3、作用及功能 二、K8S的特性 1、弹性伸缩 2、自我修复 3、服务发现和复制均衡 5、自动发布和回滚 6、集中化配置管理和秘钥管理 7、存储编排 8、任务批量处理运行 三、K8S的集群架构 四、K8S的核心组件 1、Master组件 ①Kube-apis

    2024年02月12日
    浏览(64)
  • 小白到运维工程师自学之路 第六十二集 (docker持久化与数据卷容器)

    一、概述 Docker持久化是指将容器中的数据持久保存在主机上,以便在容器重新启动或迁移时不丢失数据。由于Docker容器是临时和可变的,它们的文件系统默认是易失的,这意味着容器中的任何更改或创建的文件都只存在于此容器的生命周期内。但是,在许多场景中,我们希望

    2024年02月14日
    浏览(37)
  • 【docker】harbor-trivy镜像扫描工具安装部署(离线漏洞库)

    下载安装 下载地址:https://github.com/oras-project/oras/releases 版本查看 漏洞库下载 trivy v1版本和V2版本漏洞库下载地址不一样 trivy v2 trivy v1 在已经安装harbor的前提下 这里我的持久化目录为 /data/harbordata/trivy-adapter/trivy/

    2024年01月25日
    浏览(39)

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

博客赞助

微信扫一扫打赏

请作者喝杯咖啡吧~博客赞助

支付宝扫一扫领取红包,优惠每天领

二维码1

领取红包

二维码2

领红包