日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

一键安装Harbor仓库(shell脚本)

發(fā)布時間:2024/1/1 编程问答 34 豆豆
生活随笔 收集整理的這篇文章主要介紹了 一键安装Harbor仓库(shell脚本) 小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.

一鍵安裝Harbor倉庫,支持在線和離線安裝
前提是得有docker 和docker-compose環(huán)境
下載博主的腳本和安裝包比在線下載安裝快很多

請安裝前修改正確的hostname 或者自己更換的端口

#!/bin/bash #域名設(shè)置 hostname=192.168.56.24 #端口 port=80 #禁止用戶注冊 self_registration=off #設(shè)置只有管理員可以創(chuàng)建項(xiàng)目 project_creation_restriction=adminonly #登錄密碼 harbor_admin_password=Harbor12345# 當(dāng)前目錄 CURRENT_DIR=$(cd "$(dirname "$0")"pwd )#檢測docker是否安裝 if ! which docker >/dev/null ; thenecho -e "\033[31m 請先安裝docker \033[0m" exit fi#檢測 docker-compose是否安裝 if ! which docker-compose >/dev/null ; thenecho -e "\033[31m 請先安裝docker-compose \033[0m" exit fi##Install if which docker-compose1 >/dev/null; thenecho "檢測到 Docker Compose 已安裝,跳過安裝步驟" elseif [[ -f "$CURRENT_DIR/harbor-offline-installer-v1.2.0.tgz" ]]; thenecho "... 離線安裝 harbor"tar zxf harbor-offline-installer-v1.2.0.tgzcd harborfilePath="$CURRENT_DIR/harbor/harbor.cfg"host=1if [ $port == "80" ]thenhost=$hostnameelse host=$hostname":"$portfi sed -i "s/hostname = reg.mydomain.com/hostname = ${host}/g" $filePathsed -i "s/self_registration = on/self_registration = ${self_registration}/g" $filePathsed -i "s/project_creation_restriction = everyone/project_creation_restriction = ${project_creation_restriction}/g" $filePathsed -i "s/harbor_admin_password = Harbor12345/harbor_admin_password = ${harbor_admin_password}/g" $filePathsed -i "s/80:80/${port}:80/" ./docker-compose.yml./prepare && ./install.shecho "... 離線安裝 harbor 成功"elseecho "... 在線安裝 Harbor"cd $CURRENT_DIRwget https://github.com/vmware/harbor/releases/download/v1.2.0/harbor-online-installer-v1.2.0.tgztar zxf harbor-online-installer-v1.2.0.tgzcd harborfilePath="$CURRENT_DIR/harbor/harbor.cfg"host=1if [ $port == "80" ]thenhost=$hostnameelse host=$hostname":"$portfi sed -i "s/hostname = reg.mydomain.com/hostname = ${host}/g" $filePathsed -i "s/self_registration = on/self_registration = ${self_registration}/g" $filePathsed -i "s/project_creation_restriction = everyone/project_creation_restriction = ${project_creation_restriction}/g" $filePathsed -i "s/harbor_admin_password = Harbor12345/harbor_admin_password = ${harbor_admin_password}/g" $filePathsed -i "s/80:80/${port}:80/" ./docker-compose.ymlchmod +x install.sh./install.sh || exitdocker-compose ps echo "... 在線安裝 Harbor 成功"fi fi

在網(wǎng)絡(luò)條件不好的情況下建議離線安裝,請先下載下面的包
離線的安裝包
鏈接:https://pan.baidu.com/s/1X1JCDJktoQ1OCBgqZVMsyA
提取碼:7ab5

總結(jié)

以上是生活随笔為你收集整理的一键安装Harbor仓库(shell脚本)的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯,歡迎將生活随笔推薦給好友。