基于docker-compose 安裝harbor

harbor特性

  • 基于角色的訪問控制:用戶和存儲庫是通過“項目”組織的玩祟,用戶可以對多個鏡像倉庫統(tǒng)一命名空間擁有不同的權(quán)限。

  • 鏡像復(fù)制:可以基于具有多個Registry實例之間復(fù)制(同步)圖像和圖表。如果出現(xiàn)任何錯誤,Harbor會自動重試復(fù)制将塑。非常適合于負(fù)載平衡褥赊、高可用性跛蛋、多數(shù)據(jù)中心熬的、混合和多云場景。

  • LDAP/AD支持:Harbor與現(xiàn)有企業(yè)LDAP/AD集成赊级,用于用戶身份驗證和管理押框,并支持將LDAP組導(dǎo)入Harbor并為其分配適當(dāng)?shù)捻椖拷巧?/li>
  • 鏡像刪除和垃圾收集:鏡像可以刪除,其空間可以回收理逊。

  • 國際化:對多國語言支持(已擁有中文橡伞、英文、德文晋被、日語和俄文)兑徘;

  • 圖形化用戶界面:用戶可以輕松瀏覽、搜索存儲庫和管理項目羡洛。

  • 審計管理:跟蹤到存儲庫的所有操作挂脑。

  • RESTful API:用于大多數(shù)管理操作的RESTful API,易于與外部系統(tǒng)集成欲侮。一個嵌入式的Swagger用戶界面可用于探索和測試API崭闲。

  • 簡單部署:提供在線和離線安裝程序。此外威蕉,可以安裝到vSphere平臺的(OVA方式)虛擬設(shè)備刁俭。

Harbor 組件

  • proxy:Harbor的組件,如注冊表韧涨、UI和令牌服務(wù)牍戚,都位于反向代理之后。代理將來自瀏覽器和Docker客戶機的請求轉(zhuǎn)發(fā)到各種后端服務(wù)虑粥。
  • Registry:負(fù)責(zé)存儲Docker鏡像和處理Docker推/拉命令翘魄。由于Harbor需要對映像進(jìn)行訪問權(quán)限控制,Registry將引導(dǎo)客戶機訪問令牌服務(wù)舀奶,以便為每個pull或push請求獲取有效的令牌(token)。
  • Core Service:Harbor的核心功能斋射,主要提供以下服務(wù):

    • UI:提供圖像化的圖形用戶界面育勺,幫助人戶管理鏡像和對用戶授權(quán)。

    • webhook: 為了及時獲取registry上images的狀態(tài)變化的情況罗岖,在Registry上配置webhook涧至,把狀態(tài)變化傳遞UI模塊;

    • Token令牌服務(wù):負(fù)責(zé)根據(jù)用戶在項目中的角色為每個docker push/pull命令頒發(fā)令牌桑包。如果從Docker客戶機發(fā)送的請求中沒有令牌南蓬,注冊表將把請求重定向到令牌服務(wù)。

  • Datebase:為了給core services提供數(shù)據(jù)庫舒服,負(fù)責(zé)儲存用戶權(quán)限赘方、審計日志烧颖、Docker image分組信息等數(shù)據(jù)。

  • Job Services:提供鏡像遠(yuǎn)程負(fù)責(zé)功能窄陡,能把本地鏡像同步到其他harbor實例當(dāng)中炕淮。

  • Log Collector:為了幫助監(jiān)控Harbor運行,負(fù)責(zé)手機其他組件的log跳夭,供日后分析涂圆。

harbor 安裝

harbor github 地址 https://github.com/goharbor/harbor

harbor 官方安裝教程

下載tar包

放到在相應(yīng)的目錄/usr/local/docker/ 解壓

tar xvf harbor-offline-installer-<version>.tgz

解壓后 獲取的文件夾及文件

修改harbor.yml配置

修改主機ip 但是不能使用127.0.0.1 or localhost 默認(rèn)賬號密碼admin/Harbor12345 這里修改密碼改成123456 配置日志和data地址按實際來配置

# Configuration file of Harbor

# The IP address or hostname to access admin UI and registry service.
# DO NOT use localhost or 127.0.0.1, because Harbor needs to be accessed by external clients.
hostname: 120.79.10.212

# http related config
http:
  # port for http, default is 80. If https enabled, this port will redirect to https port
  port: 80

# https related config
# https:
#   # https port for harbor, default is 443
#   port: 443
#   # The path of cert and key files for nginx
#   certificate: /your/certificate/path
#   private_key: /your/private/key/path

# Uncomment external_url if you want to enable external proxy
# And when it enabled the hostname will no longer used
# external_url: https://reg.mydomain.com:8433

# The initial password of Harbor admin
# It only works in first time to install harbor
# Remember Change the admin password from UI after launching Harbor.
harbor_admin_password: 123456

# Harbor DB configuration
database:
  # The password for the root user of Harbor DB. Change this before any production use.
  password: 123456

# The default data volume
data_volume: /usr/local/docker/harbor/data

# Harbor Storage settings by default is using /data dir on local filesystem
# Uncomment storage_service setting If you want to using external storage
# storage_service:
#   # ca_bundle is the path to the custom root ca certificate, which will be injected into the truststore
#   # of registry's and chart repository's containers.  This is usually needed when the user hosts a internal storage with self signed certificate.
#   ca_bundle:

#   # storage backend, default is filesystem, options include filesystem, azure, gcs, s3, swift and oss
#   # for more info about this configuration please refer https://docs.docker.com/registry/configuration/
#   filesystem:
#     maxthreads: 100
#   # set disable to true when you want to disable registry redirect
#   redirect:
#     disabled: false

# Clair configuration
clair: 
  # The interval of clair updaters, the unit is hour, set to 0 to disable the updaters.
  updaters_interval: 12

  # Config http proxy for Clair, e.g. http://my.proxy.com:3128
  # Clair doesn't need to connect to harbor internal components via http proxy.
  http_proxy:  
  https_proxy:
  no_proxy: 127.0.0.1,localhost,core,registry

jobservice:
  # Maximum number of job workers in job service  
  max_job_workers: 10

chart:
  # Change the value of absolute_url to enabled can enable absolute url in chart
  absolute_url: disabled

# Log configurations
log:
  # options are debug, info, warning, error, fatal
  level: info
  # Log files are rotated log_rotate_count times before being removed. If count is 0, old versions are removed rather than rotated.
  rotate_count: 50
  # Log files are rotated only if they grow bigger than log_rotate_size bytes. If size is followed by k, the size is assumed to be in kilobytes. 
  # If the M is used, the size is in megabytes, and if G is used, the size is in gigabytes. So size 100, size 100k, size 100M and size 100G 
  # are all valid.
  rotate_size: 200M
  # The directory on your host that store log
  location: /usr/local/docker/harbor/log/
#This attribute is for migrator to detect the version of the .cfg file, DO NOT MODIFY!
_version: 1.8.0

退出保存配置完成

啟動install.sh腳本

./install.sh

查看啟動服務(wù)

docker ps | grep goharbor 

驗證啟動成功

訪問ip地址

120.79.10.212

輸入admin/123456登陸成功

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
  • 序言:七十年代末,一起剝皮案震驚了整個濱河市币叹,隨后出現(xiàn)的幾起案子润歉,更是在濱河造成了極大的恐慌,老刑警劉巖颈抚,帶你破解...
    沈念sama閱讀 218,640評論 6 507
  • 序言:濱河連續(xù)發(fā)生了三起死亡事件踩衩,死亡現(xiàn)場離奇詭異,居然都是意外死亡邪意,警方通過查閱死者的電腦和手機九妈,發(fā)現(xiàn)死者居然都...
    沈念sama閱讀 93,254評論 3 395
  • 文/潘曉璐 我一進(jìn)店門,熙熙樓的掌柜王于貴愁眉苦臉地迎上來雾鬼,“玉大人萌朱,你說我怎么就攤上這事〔卟耍” “怎么了晶疼?”我有些...
    開封第一講書人閱讀 165,011評論 0 355
  • 文/不壞的土叔 我叫張陵,是天一觀的道長又憨。 經(jīng)常有香客問我翠霍,道長,這世上最難降的妖魔是什么蠢莺? 我笑而不...
    開封第一講書人閱讀 58,755評論 1 294
  • 正文 為了忘掉前任寒匙,我火速辦了婚禮,結(jié)果婚禮上躏将,老公的妹妹穿的比我還像新娘锄弱。我一直安慰自己,他們只是感情好祸憋,可當(dāng)我...
    茶點故事閱讀 67,774評論 6 392
  • 文/花漫 我一把揭開白布会宪。 她就那樣靜靜地躺著,像睡著了一般蚯窥。 火紅的嫁衣襯著肌膚如雪掸鹅。 梳的紋絲不亂的頭發(fā)上塞帐,一...
    開封第一講書人閱讀 51,610評論 1 305
  • 那天,我揣著相機與錄音巍沙,去河邊找鬼葵姥。 笑死,一個胖子當(dāng)著我的面吹牛赎瞎,可吹牛的內(nèi)容都是我干的牌里。 我是一名探鬼主播,決...
    沈念sama閱讀 40,352評論 3 418
  • 文/蒼蘭香墨 我猛地睜開眼务甥,長吁一口氣:“原來是場噩夢啊……” “哼牡辽!你這毒婦竟也來了?” 一聲冷哼從身側(cè)響起敞临,我...
    開封第一講書人閱讀 39,257評論 0 276
  • 序言:老撾萬榮一對情侶失蹤态辛,失蹤者是張志新(化名)和其女友劉穎,沒想到半個月后挺尿,有當(dāng)?shù)厝嗽跇淞掷锇l(fā)現(xiàn)了一具尸體奏黑,經(jīng)...
    沈念sama閱讀 45,717評論 1 315
  • 正文 獨居荒郊野嶺守林人離奇死亡,尸身上長有42處帶血的膿包…… 初始之章·張勛 以下內(nèi)容為張勛視角 年9月15日...
    茶點故事閱讀 37,894評論 3 336
  • 正文 我和宋清朗相戀三年编矾,在試婚紗的時候發(fā)現(xiàn)自己被綠了熟史。 大學(xué)時的朋友給我發(fā)了我未婚夫和他白月光在一起吃飯的照片。...
    茶點故事閱讀 40,021評論 1 350
  • 序言:一個原本活蹦亂跳的男人離奇死亡窄俏,死狀恐怖蹂匹,靈堂內(nèi)的尸體忽然破棺而出,到底是詐尸還是另有隱情凹蜈,我是刑警寧澤限寞,帶...
    沈念sama閱讀 35,735評論 5 346
  • 正文 年R本政府宣布,位于F島的核電站仰坦,受9級特大地震影響履植,放射性物質(zhì)發(fā)生泄漏。R本人自食惡果不足惜悄晃,卻給世界環(huán)境...
    茶點故事閱讀 41,354評論 3 330
  • 文/蒙蒙 一玫霎、第九天 我趴在偏房一處隱蔽的房頂上張望。 院中可真熱鬧妈橄,春花似錦鼠渺、人聲如沸。這莊子的主人今日做“春日...
    開封第一講書人閱讀 31,936評論 0 22
  • 文/蒼蘭香墨 我抬頭看了看天上的太陽鹃祖。三九已至溪椎,卻和暖如春,著一層夾襖步出監(jiān)牢的瞬間,已是汗流浹背校读。 一陣腳步聲響...
    開封第一講書人閱讀 33,054評論 1 270
  • 我被黑心中介騙來泰國打工沼侣, 沒想到剛下飛機就差點兒被人妖公主榨干…… 1. 我叫王不留,地道東北人歉秫。 一個月前我還...
    沈念sama閱讀 48,224評論 3 371
  • 正文 我出身青樓蛾洛,卻偏偏與公主長得像,于是被迫代替她去往敵國和親雁芙。 傳聞我的和親對象是個殘疾皇子轧膘,可洞房花燭夜當(dāng)晚...
    茶點故事閱讀 44,974評論 2 355

推薦閱讀更多精彩內(nèi)容