栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > Java

【Docker】 安装 nexus3

Java 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

【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)。

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/591417.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号