在docker中搭建nexus3(maven私有仓库)

目录

1.拉取nexus3镜像

2.启动nexus3 

3.登入nexus可视化页面


1.拉取nexus3镜像

root@123:~# docker pull sonatype/nexus3
Using default tag: latest
latest: Pulling from sonatype/nexus3
26f1167feaf7: Pull complete 
adffa6963146: Pull complete 
e88dfbe0ef6a: Pull complete 
0d43c5e95446: Pull complete 
8ff7b45a7e29: Pull complete 
Digest: sha256:eff4fb12346ceb5cd424732ee9f2765c0db0f8d5032cdb2f7f7e17acc349f651
Status: Downloaded newer image for sonatype/nexus3:latest
docker.io/sonatype/nexus3:latest

2.启动nexus3 

docker run \
-d \
--restart always \
--name nexus3 \
-p 8081:8081 \
-v /usr/local/docker/nexus3:/var/nexus-data \
sonatype/nexus3

服务器内存不多时, 可限制内存大小

docker run \
-d \
--restart always \
--name nexus3 \
-p 8081:8081 \
--privileged=true \
-e INSTALL4J_ADD_VM_PARAMS="-Xms512M -Xmx512M -XX:MaxDirectMemorySize=512M" \
-v /usr/local/docker/nexus3:/var/nexus-data \
sonatype/nexus3

3.登入nexus可视化页面

进入容器查看密码

root@123:~# docker exec -it nexus3 /bin/bash
bash-4.4$ cd nexus-data/
bash-4.4$ ls
admin.password  cache  db  elasticsearch  etc  generated-bundles  instances  karaf.pid  keystores  lock  log  orient  port  restore-from-backup  tmp
bash-4.4$ cat admin.password 
58f0260a-15bf-4e6a-b672-84028de32037

页面地址 ip:8081

点击登录

输入 账号:admin 密码:cat admin.password的结果

登录进来后会让设置新的密码 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值