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

歡迎訪問 生活随笔!

生活随笔

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

编程问答

【Docker】 安装 nexus3

發(fā)布時間:2024/9/19 编程问答 25 豆豆
生活随笔 收集整理的這篇文章主要介紹了 【Docker】 安装 nexus3 小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.

前言

  • CentOS Linux release 7.9.2009 (Core)
  • Docker version 1.13.1

準(zhǔn)備

  • docker 已安裝。
  • 選擇合適的nexus3 鏡像(這里使用:sonatype/nexus3:3.36.0)。

拉取鏡像

shell> docker pull sonatype/nexus3:3.36.0 Trying to pull repository docker.io/sonatype/nexus3 ... 3.36.0: Pulling from docker.io/sonatype/nexus3 262268b65bd5: Pull complete 06038631a24a: Pull complete 50539d8bb585: Pull complete c85fea177c04: Pull complete 6f4fa3a69090: Pull complete Digest: sha256:f7c805f51a44dc55163dc05525c96dc845c6cff58572c3cc02af00dfb9a111ba Status: Downloaded newer image for docker.io/sonatype/nexus3:3.36.0

查看拉取的鏡像

shell> docker images REPOSITORY TAG IMAGE ID CREATED SIZE docker.io/sonatype/nexus3 3.36.0 8e82bd6e4710 3 weeks ago 656 MB docker.io/hello-world latest feb5d9fea6a5 2 months ago 13.3 kB

創(chuàng)建但不運(yùn)行容器

shell> mkdir -p /data/nexus1/data && chown -R 200 /data/nexus1/data shell> docker create --restart=always --name nexus1 \ -v /data/nexus1/data:/nexus-data \ -p 8081:8081 sonatype/nexus3:3.36.0
  • chown -R 200 /data/nexus1/data:/data/nexus1/data的目錄所有者是用戶200。
  • --restart=always: 自動運(yùn)行
  • -v /data/nexus1/data:/nexus-data: 將宿主機(jī)的/data/nexus1/data掛載成容器的/nexus-data目錄

運(yùn)行容器

shell> docker start nexus1

查看日志

shell> docker logs -f nexus1

查看容器運(yùn)行狀態(tài)

shell> docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 565a2c6bbecf sonatype/nexus3:3.36.0 "sh -c ${SONATYPE_..." 4 minutes ago Up 4 minutes 0.0.0.0:8081->8081/tcp nexus1

打開Nexus

http://localhost:8081/

登錄Nexus

Nexus 提示密碼:Your admin user password is located in /nexus-data/admin.password on the server.

查看密碼:

shell> cat /data/nexus1/data/admin.password b199a989-d81f-3f51-bebc-b78f6ae3e5d1

點(diǎn)擊Nexus頁面的右上角進(jìn)行登錄,通過初始用戶名和密碼進(jìn)行登錄(admin/b199a989-d81f-3f51-bebc-b78f6ae3e5d1)。

指定參數(shù)

shell> mkdir -p /data/nexus1/data && chown -R 200 /data/nexus1/data shell> docker create --restart=always --name nexus1 \ -v /data/nexus1/data:/nexus-data \ -e INSTALL4J_ADD_VM_PARAMS="-Xms512m -Xmx512m -XX:MaxDirectMemorySize=512m" \ -p 8081:8081 sonatype/nexus3:3.36.0
  • 占用內(nèi)存512m

總結(jié)

以上是生活随笔為你收集整理的【Docker】 安装 nexus3的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

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