Docker中怎么安裝nexus3,相信很多沒有經(jīng)驗(yàn)的人對(duì)此束手無策,為此本文總結(jié)了問題出現(xiàn)的原因和解決方法,通過這篇文章希望你能解決這個(gè)問題。
專注于為中小企業(yè)提供成都網(wǎng)站制作、網(wǎng)站設(shè)計(jì)、外貿(mào)網(wǎng)站建設(shè)服務(wù),電腦端+手機(jī)端+微信端的三站合一,更高效的管理,為中小企業(yè)瑪沁免費(fèi)做網(wǎng)站提供優(yōu)質(zhì)的服務(wù)。我們立足成都,凝聚了一批互聯(lián)網(wǎng)行業(yè)人才,有力地推動(dòng)了上千家企業(yè)的穩(wěn)健成長(zhǎng),幫助中小企業(yè)通過網(wǎng)站建設(shè)實(shí)現(xiàn)規(guī)模擴(kuò)充和轉(zhuǎn)變。
CentOS 7.6
Docker 19.03.4
查找nexus3鏡像
docker search nexus3
控制臺(tái)輸出
[root@xxx ~]# docker search nexus3 NAME DESCRIPTION STARS OFFICIAL AUTOMATED sonatype/nexus3 Sonatype Nexus Repository Manager 3 693 shifudao/nexus3 clone from nexus3 image but based from openj… 4 [OK] madmuffin/nexus3 Sonatype Nexus3 Milestone7 docker image 2 [OK] home1oss/nexus3 An auto configured nexus3 2 [OK] fxinnovation/nexus3 Sonatype Nexus 3 in a container 1 [OK] flavioaiello/nexus3 Production ready lightweight Nexus3 with API… 1 [OK] cirepo/nexus3 An auto configured nexus3 1 [OK] alvindaiyan/nexus3-azure-appservice 1 dwolla/nexus3-crowd Nexus3 with nexus3-crowd-plugin installed 0 [OK] joshdvir/nexus3 nexus3 0 [OK] freckleiot/nexus3-oss A Sonatype Nexus3 OSS image which makes it e… 0 [OK] sdase/nexus3-base-image An opinionated nexus3 docker image, based on… 0 [OK] fgbulsoni/nexus3 My fork of the Sonatype/Nexus3 image, with a… 0 stocksoftware/nexus3 A nexus3 docker instance 0 [OK] lokkju/nexus3-github-auth Sonatype Nexus 3 with Github authentication … 0 [OK] salte/nexus3 Extends the Sonatype nexus3 Docker image by … 0 [OK] azaa1/nexus3 Sonyatype Nexus Repository Manager 3 0 desiato/nexus3-ssl Sonatype Nexus 3 with SSL/TLS support. 0 [OK] mritd/nexus3 nexus3 0 [OK] jullyannem/nexus3 Custom image for sonatype/nexus3 0 bigseasre/nexus3 mirror of the original nexus3 dockerfile 0 darthhater/nexus3 A series of example Dockerfiles and images f… 0 [OK] nasajon/nexus3 Nexus3 0 [OK] enieuw/nexus3-oss nexus3-oss 0 [OK] amribrahim00/nexus3 0
拉取nexus3鏡像
docker pull docker.io/sonatype/nexus3
控制臺(tái)輸出
[root@xxx ~]# docker pull docker.io/sonatype/nexus3 Using default tag: latest latest: Pulling from sonatype/nexus3 c65691897a4d: Pull complete 641d7cc5cbc4: Pull complete c508b13320cd: Pull complete 79e3bf9d3132: Pull complete Digest: sha256:2c33632ccd1f8c5f9023a3d7f5f541e211831e402219f8c5a83a29d1721457ca Status: Downloaded newer image for sonatype/nexus3:latest docker.io/sonatype/nexus3:latest
查看鏡像
docker images
控制臺(tái)輸出
[root@xxx ~]# docker images REPOSITORY TAG IMAGE ID CREATED SIZE sonatype/nexus3 latest 8eb898be2a53 2 weeks ago 611MB
4.運(yùn)行nexus容器
docker run -id --privileged=true --name=nexus3 --restart=always -p 8081:8081 -v /wandou/nexus3/nexus-data:/var/nexus-data sonatype/nexus3
控制臺(tái)輸出
[root@xxx ~]# docker run -id --privileged=true --name=nexus3 --restart=always -p 8081:8081 -v /wandou/nexus3/nexus-data:/var/nexus-data sonatype/nexus3 980f3759783f3ba7e59302848f816e371b229957f2c12b8f92934d468e061b00
解釋: -id 創(chuàng)建守護(hù)式容器 --privileged=true 授予root權(quán)限(掛載多級(jí)目錄必須為true,否則容器訪問宿主機(jī)權(quán)限不足) --name=名字 給你的容器起個(gè)名字 -p 宿主機(jī)端口:容器端口映射 -v 宿主機(jī)目錄:容器目錄 目錄掛載 這里需要些許時(shí)間才能啟動(dòng)并訪問nexus 事機(jī)器配置而定 5.訪問nexus3 請(qǐng)先確保服務(wù)器的8081(視上面運(yùn)行nexus容器時(shí)配置的端口而定)端口在安全組里已開啟!!! 瀏覽器訪問http://ip:8081
6.登錄 進(jìn)入nexus3頁面后右上角有個(gè)登錄的按鈕點(diǎn)擊顯示登錄框 nexus3默認(rèn)的賬號(hào)依舊是admin
但是密碼已經(jīng)變了具體的密碼存儲(chǔ)在nexus3的容器的nexus-data路徑內(nèi)的admin.password
文件內(nèi) 具體操作: 1.查看nexus3容器id
docker ps
控制臺(tái)顯示
[root@ecs-s6-xlarge-2-linux-20190927141629 ~]# docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 980f3759783f sonatype/nexus3 "sh -c ${SONATYPE_DI…" 4 minutes ago Up 4 minutes 0.0.0.0:8081->8081/tcp nexus3
記下CONTAINER ID
:980f3759783f 2.進(jìn)入容器控制臺(tái)
docker exec -it 980f3759783f bash
控制臺(tái)顯示
[root@ecs-s6-xlarge-2-linux-20190927141629 ~]# docker exec -it 980f3759783f bash bash-4.4$ ls bin etc lib lost+found nexus-data root srv uid_entrypoint.sh var boot help.1 lib64 media opt run sys uid_template.sh dev home licenses mnt proc sbin tmp usr
3.進(jìn)入nexus-data
文件夾
bash-4.4$ cd nexus-data/ bash-4.4$ ls admin.password db generated-bundles karaf.pid log restore-from-backup blobs elasticsearch instances keystores orient tmp cache etc javaprefs lock port
4.打開admin.password
文件
bash-4.4$ vi admin.password
第一行就是密碼啦,復(fù)制密碼用admin
帳號(hào)登錄,登錄以后系統(tǒng)會(huì)自動(dòng)提示你更換admin
的密碼
看完上述內(nèi)容,你們掌握Docker中怎么安裝nexus3的方法了嗎?如果還想學(xué)到更多技能或想了解更多相關(guān)內(nèi)容,歡迎關(guān)注創(chuàng)新互聯(lián)行業(yè)資訊頻道,感謝各位的閱讀!
網(wǎng)站名稱:Docker中怎么安裝nexus3
路徑分享:http://jinyejixie.com/article14/pphoge.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供外貿(mào)網(wǎng)站建設(shè)、App開發(fā)、網(wǎng)站排名、域名注冊(cè)、企業(yè)網(wǎng)站制作、關(guān)鍵詞優(yōu)化
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來源: 創(chuàng)新互聯(lián)