Harbor:私有企業級Registry倉庫--快速搭建

前言

???Harbor可以通過Docker Composer的方式來部署,如果有正常運行的k8s環境,也可以使用k8s來部署Harbor,本文采用 Docker Composer的方式。?


準備

??假定Linux系統為Centos 7。

docker ,默認安裝即可
yum -y install docker
1
docker compose ,安裝最新版
curl -L https://github.com/docker/compose/releases/download/1.18.0/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose
1
2
harbor離線安裝包,下載最新版本,如果在線下載失敗,我上傳了一份到百度云:https://pan.baidu.com/s/1dnDZjg
wget https://storage.googleapis.com/harbor-releases/harbor-offline-installer-v1.3.0.tgz
1
導入 harbor 鏡像

??解壓harbor離線安裝包

tar -xzvf harbor-offline-installer-v1.3.0.tgz
1
??進入harbor目錄

cd harbor
1
??有如下文件:

??導入harbor鏡像

docker load -i harbor.v1.3.0.tar.gz
1
如果提示:Cannot connect to the Docker daemon. Is the docker daemon running on this host? 是因為docker服務未啟動,使用systemctl start docker命令運行docker。

修改 harbor 配置

??編輯 harbor.cfg文件

vi harbor.cfg
1
??修改hostname為自己機器的ip地址

hostname = 192.168.22.83
1
??當然,harbor還有很多配置項可以修改,來滿足一些企業級的功能特性,比如可以使用https來保證文件傳輸的安全。在這里,為了可以快速上手,只進行簡單的配置。

安裝與啟動

??執行 install.sh 腳本

./install.sh
1
??等待安裝完成:

[Step 0]: checking installation environment ...

Note: docker version: 1.12.6

Note: docker-compose version: 1.18.0

[Step 1]: loading Harbor images ...
Loaded image: vmware/harbor-adminserver:v1.3.0
Loaded image: vmware/photon:1.0
Loaded image: vmware/notary-photon:signer-0.5.1
Loaded image: vmware/postgresql:9.6.5-photon
Loaded image: vmware/harbor-db-migrator:1.3
Loaded image: vmware/harbor-ui:v1.3.0
Loaded image: vmware/harbor-log:v1.3.0
Loaded image: vmware/nginx-photon:1.11.13
Loaded image: vmware/mariadb-photon:10.2.10
Loaded image: vmware/clair:v2.0.1-photon
Loaded image: vmware/harbor-db:v1.3.0
Loaded image: vmware/harbor-jobservice:v1.3.0
Loaded image: vmware/registry:2.6.2-photon
Loaded image: vmware/notary-photon:server-0.5.1


[Step 2]: preparing environment ...
Clearing the configuration file: ./common/config/adminserver/env
Clearing the configuration file: ./common/config/ui/env
Clearing the configuration file: ./common/config/ui/app.conf
Clearing the configuration file: ./common/config/ui/private_key.pem
Clearing the configuration file: ./common/config/db/env
Clearing the configuration file: ./common/config/jobservice/env
Clearing the configuration file: ./common/config/jobservice/app.conf
Clearing the configuration file: ./common/config/registry/config.yml
Clearing the configuration file: ./common/config/registry/root.crt
Clearing the configuration file: ./common/config/nginx/cert/harbor.pem
Clearing the configuration file: ./common/config/nginx/cert/harbor-key.pem
Clearing the configuration file: ./common/config/nginx/nginx.conf
Clearing the configuration file: ./common/config/log/logrotate.conf
loaded secret from file: /data/secretkey
Generated configuration file: ./common/config/nginx/nginx.conf
Generated configuration file: ./common/config/adminserver/env
Generated configuration file: ./common/config/ui/env
Generated configuration file: ./common/config/registry/config.yml
Generated configuration file: ./common/config/db/env
Generated configuration file: ./common/config/jobservice/env
Generated configuration file: ./common/config/log/logrotate.conf
Generated configuration file: ./common/config/jobservice/app.conf
Generated configuration file: ./common/config/ui/app.conf
Generated certificate, key file: ./common/config/ui/private_key.pem, cert file: ./common/config/registry/root.crt
The configuration files are ready, please use docker-compose to start the service.

Creating harbor-log ... done
[Step 3]: checking existing instance of Harbor ...

Creating registry ... done
Creating harbor-ui ... done
Creating network "harbor_harbor" with the default driver
Creating nginx ... done
Creating harbor-adminserver ...?
Creating harbor-db ...?
Creating registry ...?
Creating harbor-ui ...?
Creating harbor-jobservice ...?
Creating nginx ...?

? ----Harbor has been installed and started successfully.----

Now you should be able to visit the admin portal at https://192.168.22.83.?
For more details, please visit https://github.com/vmware/harbor .

??在瀏覽器中輸入ip地址:http://192.168.22.83(注意這里使用http協議,而非https),用戶名:admin 密碼:Harbor12345(可以harbor.cfg文件中設置) ,登錄看到barbor的圖像界面:?


小結

??harbor 安裝成功后,可以分別通過以下命令來停止啟動(注意:需要在上面提到的harbor目錄中執行)

docker-compose down -v
//停止

docker-compose up -d
//啟動
?

本文來自互聯網用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務,不擁有所有權,不承擔相關法律責任。
如若轉載,請注明出處:http://www.pswp.cn/news/386739.shtml
繁體地址,請注明出處:http://hk.pswp.cn/news/386739.shtml
英文地址,請注明出處:http://en.pswp.cn/news/386739.shtml

如若內容造成侵權/違法違規/事實不符,請聯系多彩編程網進行投訴反饋email:809451989@qq.com,一經查實,立即刪除!

相關文章

java-Mysql學生管理系統

Window1//主方法 package stu_zizhu1; import java.awt.Button; import java.awt.Color; import java.awt.Dimension; import java.awt.FlowLayout; import java.awt.Point; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import javax.swing.JBu…

Docker版本Jenkins的使用

Docker版本Jenkins的使用 低調的微胖關注贊賞支持 Docker版本Jenkins的使用 12018.05.15 18:21:50字數 1202閱讀 22588 一. 什么是Jenkins Jenkins是當前非常流行的一款持續集成工具,可以幫助大家把更新后的代碼自動部署到服務器上運行。 二. 為什么用docker版…

小程序 setData 中的坑,其實好像...

最近這段時間在寫微信小程序,有一個頁面需要動態修改 data 中的數據,而這里似乎是個坑。 1、正常修改 正常修改很簡單,當觸發 change 事件時,數據和頁面都會同時發生改變。這個也不用多說,很簡單的例子。 2、如何修改對…

CentOS HarBor安裝與配置

HarBor 安裝與配置 Prerequisites for the target host ResourceCapacityDescriptionCPUminimal 2 CPU4 CPU is preferredMemminimal 4GB8GB is preferredDiskminimal 40GB160GB is preferred 環境 centos7harbor v1.6.3python v2.7及以上docker v1.10及以上docker-compose …

冪等

一種方案是創建唯一索引。在數據庫中針對我們需要約束的資源字段創建唯一索引,可以防止插入重復數據。但是,遇到分庫分表的場景,唯一索引也就不那么好使了, 此時,我們可以先查詢數據庫,判斷約束的資源字段是…

ELK 刪除索引只保留10天

delelk.sh: #!/bin/bash #定時清除elk索引,10天 DATEdate -d "10 days ago" %Y.%m.%d curl -XDELETE "http://127.0.0.1:9400/*-${DATE}" 127.0.0.1:9400 ES的地址 定時任務執行此腳本 30 17 * bash /home/scripts/delelk.sh

通過ceph-deploy搭建ceph 13.2.5 mimic

一、ceph介紹 操作系統需要內核版本在kernel 3.10或CentOS7以上版本中部署通過deploy工具安裝簡化部署過程,本文中選用的ceph-deploy版本為1.5.39至少準備6個環境,分別為1個ceph-admin管理節點、3個mon/mgr/mds節點、2個osd節點二、ceph安裝 1. 部署ceph…

openstack服務編排

heat列出所有組件時報錯 ERROR: 503 Service Unavailable The server is currently unavailable. Please try again at a later time. 錯誤:503服務不可用 cu錯 w誤 : 5 0 3 f服 w務 b不 kě可 yng用 The server is currently unavailable. Please tr…

phpstudy如何安裝景安ssl證書 window下apache服務器網站https訪問

1. 下載景安免費證書 https://www.zzidc.com/help/helpDetail?id555 2.文件解壓上傳至服務器,位置自己決定 3. 調整apache配置 景安原文鏈接:https://www.zzidc.com/help/helpDetail?id555 ① 確保你的apache編譯了ssl模塊,這是支持ssl證書…

docker下gitlab安裝配置使用(完整版)

docker下gitlab安裝配置使用(完整版) 22018.12.16 00:07:57字數 737閱讀 17595 docker 安裝gitlab以及使用 一、安裝及配置 1.gitlab鏡像拉取 # gitlab-ce為穩定版本,后面不填寫版本則默認pull最新latest版本 $ docker pull gitlab/gitlab-ce拉取鏡像 2.運行g…

hdfs的特性、命令、安全模式、基準測試

1.第一點:如何理解hdfs分布式文件系統,每臺機器出一塊磁盤,湊成一個大的硬盤,大的硬盤的容量來自各個服務器的硬盤容量之和。 你出5毛,我出5毛,大家湊成1塊。 2. HDFS 是 Hadoop Distribute File System 的…

如何push一個docker鏡像到DockerHub上

如何push一個docker鏡像到DockerHub上 2018.01.03 11:31:39字數 139閱讀 202 有時候想要保存自己的docker鏡像,又不想自己搭建docker registry,那么就可以了借用DockerHub來用,一般不會有多少人在意你的鏡像,不過萬一被人看上了…

測開2 - Python(文件操作)

把第一次寫好漏掉的點寫在最前面:文件讀寫的內容都要求是字符串。 幾種文件操作的模式: 1. r,讀模式(默認模式),只能讀不能寫,文件不存在時報錯 2. w,寫模式,只能寫不能讀…

使用docker在CentOS7上搭建WordPress

前言 本文基于Centos 7 環境的docker搭建操作,centos 7 用 firewalld 替換了iptables作為默認防火墻操作,但以前習慣了iptables 就不與時俱進了。 環境準備 systemctl disable firewalld systemctl stop firewalld setenforce 0 sed -i "s/SELIN…

企業級應用,如何實現服務化一(項目架構演化)

1.企業級應用架構演化 1.1.架構演化圖 1.2.文字描述 #單一應用架構當網站流量很小時,只需一個應用,將所有功能都部署在一起,以減少部署節點和成本#垂直應用架構當訪問量逐漸增大,單一應用增加機器帶來的加速度越來越小&#xff0c…

Alpine 操作系統是一個面向安全的輕型 Linux 發行版

Alpine 操作系統是一個面向安全的輕型 Linux 發行版。它不同于通常 Linux 發行版,Alpine 采用了 musl libc 和 busybox 以減小系統的體積和運行時資源消耗,但功能上比 busybox 又完善的多,因此得到開源社區越來越多的青睞。在保持瘦身的同時&…

ASP.NET MVC Filter過濾機制(過濾器、攔截器)

https://blog.csdn.net/knqiufan/article/details/82413885 本文為博主原創文章,未經博主允許不得轉載。 https://blog.csdn.net/knqiufan/article/details/82413885參考文章:1、https://www.cnblogs.com/webapi/p/5669057.html 2、htt…

elk docker

換了個運行環境,重新搭建一套公司本地內部的ELK,之前也搭過(可訪問:https://yanganlin.com/31.html),最近做什么事情都想用Docker,這次也用Docker,還算順利,沒掉什么坑里,上次搭建,也用用的6.2的版本,這都過了一年,Elk這三個產品,都已經上7了,用docker搭建的還是用6.2.4,穩定不…

LeetCode Largest Number

1231231轉載于:https://www.cnblogs.com/ZHONGZHENHUA/p/10954249.html

有個需求mybatis?插入的時候不知道有哪些字段,需要動態的傳入值和字段

有個需求mybatis 插入的時候不知道有哪些字段,需要動態的傳入值和字段, Java code? 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 Test public void testAddProductGuaranty() { //1 560 50000 2014/10/2 0:00:00 2014/11/1 0…