Docker安装nexus3,搭建maven私服

1、拉取镜像

docker pull sonatype/nexus3

[root@localhost ~]# docker pull sonatype/nexus3
Using default tag: latest
latest: Pulling from sonatype/nexus3
0bb54aa5e977: Pull complete 
941e1e2b31a8: Pull complete 
fb7cd7cf24c9: Pull complete 
4e63afcbf773: Pull complete 
Digest: sha256:81d182285d279081e80e74dbd13cb544fdf4255efadd61321436a577f56b87ad
Status: Downloaded newer image for sonatype/nexus3:latest
docker.io/sonatype/nexus3:latest
2、配置外部挂载文件夹

mkdir -p /usr/local/nexus-data && chmod 751 /usr/local/nexus-data

[root@localhost local]# mkdir -p /usr/local/nexus-data && chmod  -R 771 nexus-data/
[root@localhost local]# ll
总用量 50504
drwxr-xr-x.  9 root root      220 2月  29 12:57 apache-tomcat-8.5.35
drwxr-xr-x.  3 root root       60 9月  12 2019 java
drwxr-x---. 13 root root     4096 3月  16 17:53 jenkins
drwxr-xr-x.  5 root root      133 3月  24 10:02 jenkins-publish
drwxr-xr-x.  4 root root       89 3月   4 02:19 maven
drwxr-x--x.  2 root root        6 4月  10 17:33 nexus-data
3、安装

docker run -d -p 28080:8081 --name nexus -v /usr/local/nexus-data:/nexus-data sonatype/nexus3

[root@localhost ~]# docker run -d -p 28080:8081 --name nexus -v /usr/local/nexus-data:/nexus-data sonatype/nexus3
e8751fb2c8f4fae2a33b0a0b466aa8f4bdab200bde095a7ac0edea52e9105c8c
[root@localhost ~]# docker container ps
CONTAINER ID        IMAGE                 COMMAND                  CREATED             STATUS              PORTS                     NAMES
e8751fb2c8f4        sonatype/nexus3       "sh -c ${SONATYPE_DI…"   3 seconds ago       Up 2 seconds        0.0.0.0:28080->8081/tcp   nexus
717172393d6f        portainer/portainer   "/portainer"             6 months ago        Up 9 hours          0.0.0.0:9000->9000/tcp    upbeat_poincare

4、进入挂载目录,找到登录密码

[root@localhost nexus-data]# ll
总用量 28
-rw-r--r--.   1 200 200   36 4月  10 18:11 admin.password
drwxr-xr-x.   3 200 200   21 4月  10 18:11 blobs
drwxr-xr-x. 312 200 200 8192 4月  10 18:10 cache
drwxr-xr-x.   6 200 200  113 4月  10 18:11 db
drwxr-xr-x.   3 200 200   19 4月  10 18:11 elasticsearch
drwxr-xr-x.   3 200 200   45 4月  10 18:10 etc
drwxr-xr-x.   2 200 200    6 4月  10 18:10 generated-bundles
drwxr-xr-x.   2 200 200   33 4月  10 18:10 instances
drwxr-xr-x.   3 200 200   19 4月  10 18:10 javaprefs
-rw-r--r--.   1 200 200    1 4月  10 18:10 karaf.pid
drwxr-xr-x.   3 200 200   18 4月  10 18:11 keystores
-rw-r--r--.   1 200 200   14 4月  10 18:10 lock
drwxr-xr-x.   3 200 200  112 4月  10 18:11 log
drwxr-xr-x.   2 200 200    6 4月  10 18:11 orient
-rw-r--r--.   1 200 200    5 4月  10 18:10 port
drwxr-xr-x.   2 200 200    6 4月  10 18:11 restore-from-backup
drwxr-xr-x.   8 200 200  262 4月  10 18:11 tmp
[root@localhost nexus-data]
  • 3
    点赞
  • 12
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值