(一)Harbor安裝 -- 企業級Registry倉庫

根據Harbor官方描述:html

  Harbor是一個用於存儲和分發Docker鏡像的企業級Registry服務器,經過添加一些企業必需的功能特性,例如安全、標識和管理等,擴展了開源Docker Distribution。做爲一個企業級私有Registry服務器,Harbor提供了更好的性能和安全。提高用戶使用Registry構建和運行環境傳輸鏡像的效率。Harbor支持安裝在多個Registry節點的鏡像資源複製,鏡像所有保存在私有Registry中, 確保數據和知識產權在公司內部網絡中管控。另外,Harbor也提供了高級的安全特性,諸如用戶管理,訪問控制和活動審計等。nginx

 

轉載請標明出處:http://www.cnblogs.com/huangjc/p/6266564.htmlgit

 

如下進入實際操做:github

部署環境:docker

centos-7.2
docker-engine-1.12.5
docker-compose-1.9.0
harbor-0.5.0

 

一、下載所需的軟件包(如下須要-翻-牆-下載的地方大家本身解決吧......):vim

(1)下載docker-compose:centos

curl -L https://github.com/docker/compose/releases/download/1.9.0/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose

(2)下載harbor:瀏覽器

wget https://github.com/vmware/harbor/releases/download/0.5.0/harbor-offline-installer-0.5.0.tgz
#我下載的是offline離線包,這樣在後續的部署及安裝都會比較快,總共有300M左右的大小!

 (3)解壓,配置harbor:安全

tar zxvf harbor-offline-installer-0.5.0.tgz
cd harbor/

#vim harbor.cfg
hostname = 192.168.6.113
#這裏只是簡單的測試,因此只編輯這一行,其餘的默認不作修改;固然也能夠根據你本身的實際狀況作修改!

(4)配置docker:bash

#由於docker默認使用的是https鏈接,而harbor默認使用http鏈接,因此須要修改docker配置標誌insecure registry不安全倉庫的主機!
#固然,harbor也能夠設置爲https,這個後續文章中再列出操做方法吧! #vim
/usr/lib/systemd/system/docker.service ExecStart=/usr/bin/dockerd --insecure-registry=192.168.6.113 #只加上--insecure-registry這個參數便可。

#重啓docker:
#systemctl daemon-reload
#systemctl restart docker.service

(5)執行安裝腳本:

#會拉取好幾個鏡像下來,及檢查環境:

#./instsll.sh
Note: docker version: 1.12.5
Note: docker-compose version: 1.9.0
[Step
0]: checking installation environment ... ....
[Step
1]: loading Harbor images ... ....
[Step
2]: preparing environment ... ....
[Step
3]: checking existing instance of Harbor ... ....
[Step
4]: starting Harbor ... .... ✔ ----Harbor has been installed and started successfully.---- Now you should be able to visit the admin portal at http://192.168.6.113. For more details, please visit https://github.com/vmware/harbor .

安裝完成後會生成以下6個容器:

# docker ps
CONTAINER ID        IMAGE                            COMMAND                  CREATED             STATUS              PORTS                                      NAMES
e6f0baa7ddb7        nginx:1.11.5                     "nginx -g 'daemon off"   6 minutes ago       Up 6 minutes        0.0.0.0:80->80/tcp, 0.0.0.0:443->443/tcp   nginx
1b383261d0c7        vmware/harbor-jobservice:0.5.0   "/harbor/harbor_jobse"   6 minutes ago       Up 6 minutes                                                   harbor-jobservice
86f1d905ec78        vmware/harbor-db:0.5.0           "docker-entrypoint.sh"   6 minutes ago       Up 6 minutes        3306/tcp                                   harbor-db
9cbab69f20b6        library/registry:2.5.0           "/entrypoint.sh serve"   6 minutes ago       Up 6 minutes        5000/tcp                                   registry
9c5693a53f4e        vmware/harbor-ui:0.5.0           "/harbor/harbor_ui"      6 minutes ago       Up 6 minutes                                                   harbor-ui
8bef4c4c47f0        vmware/harbor-log:0.5.0          "/bin/sh -c 'crond &&"   6 minutes ago       Up 6 minutes        0.0.0.0:1514->514/tcp                      harbor-log

Harbor容器的stop與start:

進入Harbor目錄執行以下命令便可:

docker-compose stop/start

 

到此便安裝完成了,直接打開瀏覽器登錄便可:

默認用戶密碼是:admin/Harbor12345

相關文章
相關標籤/搜索