【Docker】 安装 nexus3
生活随笔
收集整理的這篇文章主要介紹了
【Docker】 安装 nexus3
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
前言
- CentOS Linux release 7.9.2009 (Core)
- Docker version 1.13.1
準備
- 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創建但不運行容器
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: 自動運行
- -v /data/nexus1/data:/nexus-data: 將宿主機的/data/nexus1/data掛載成容器的/nexus-data目錄
運行容器
shell> docker start nexus1查看日志
shell> docker logs -f nexus1查看容器運行狀態
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點擊Nexus頁面的右上角進行登錄,通過初始用戶名和密碼進行登錄(admin/b199a989-d81f-3f51-bebc-b78f6ae3e5d1)。
指定參數
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- 占用內存512m
總結
以上是生活随笔為你收集整理的【Docker】 安装 nexus3的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 泰瑞亚小兵成长历险记——阿什福德平原
- 下一篇: 如何删除无用的打开方式