docker部署nexus3私服

mkdir /home/data/nexus-data

chmod 777 nexus-data

docker run --restart="always" -d -p 8899:8081 --name nexus -v /home/data/nexus-data:/nexus-data sonatype/nexus3

訪問:http://localhost:8899

登錄:用戶名:admin? 密碼:第一次密碼要用 /home/data/nexus-data/admin.password中的密碼,登錄之后系統(tǒng)會提示修改密碼

mkdir /home/repo2

chmod -R 777 /home/repo2

vi mavenimport2.sh

************** 內(nèi)容 start **************

#!/bin/bash

# copy and run this script to the root of the repository directory containing files

# this script attempts to exclude uploading itself explicitly so the script name is important

# Get command line params

while getopts ":r:u:p:" opt; do

? ? case $opt in

? ? ? ? r) REPO_URL="$OPTARG"

? ? ? ? ;;

? ? ? ? u) USERNAME="$OPTARG"

? ? ? ? ;;

? ? ? ? p) PASSWORD="$OPTARG"

? ? ? ? ;;

? ? esac

done

find . -type f -not -path './mavenimport\.sh*' -not -path '*/\.*' -not -path '*/\^archetype\-catalog\.xml*' -not -path '*/\^maven\-metadata\-local*\.xml' -not -path '*/\^maven\-metadata\-deployment*\.xml' | sed "s|^\./||" | xargs -I '{}' curl -u "$USERNAME:$PASSWORD" -X PUT -v -T {} ${REPO_URL}/{} ;

************** 內(nèi)容 end **************

cd /home/repo2

將本地的manven倉庫壓縮,如果本地壓縮文件大于4G建議采用7z進(jìn)行壓縮,然后傳到服務(wù)器到進(jìn)行解壓

7za a spring_cloud_resposiory.7z spring_cloud_resposiory/

7za x spring_cloud_resposiory.7z

mv mavenimport2.sh /home/repo2/spring_cloud_resposiory/

將mavenimport2.sh文件放入spring_cloud_resposiory文件中

./mavenimport2.sh? -u admin -p admin123 -r http://192.168.0.129:8899/repository/znyg/

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。

友情鏈接更多精彩內(nèi)容