千家信息网

Docker中怎么安装nexus3

发表于:2026-11-03 作者:千家信息网编辑
千家信息网最后更新 2026年11月03日,Docker中怎么安装nexus3,相信很多没有经验的人对此束手无策,为此本文总结了问题出现的原因和解决方法,通过这篇文章希望你能解决这个问题。1.搭建环境CentOS 7.6Docker 19.03
千家信息网最后更新 2026年11月03日Docker中怎么安装nexus3

Docker中怎么安装nexus3,相信很多没有经验的人对此束手无策,为此本文总结了问题出现的原因和解决方法,通过这篇文章希望你能解决这个问题。

1.搭建环境

  • CentOS 7.6

  • Docker 19.03.4

2.具体步骤

  1. 查找nexus3镜像

docker search nexus3

控制台输出

[root@xxx ~]# docker search nexus3NAME                                  DESCRIPTION                                     STARS               OFFICIAL            AUTOMATEDsonatype/nexus3                       Sonatype Nexus Repository Manager 3             693                                     shifudao/nexus3                       clone from nexus3 image but based from openj…   4                                       [OK]madmuffin/nexus3                      Sonatype Nexus3 Milestone7 docker image         2                                       [OK]home1oss/nexus3                       An auto configured nexus3                       2                                       [OK]fxinnovation/nexus3                   Sonatype Nexus 3 in a container                 1                                       [OK]flavioaiello/nexus3                   Production ready lightweight Nexus3 with API…   1                                       [OK]cirepo/nexus3                         An auto configured nexus3                       1                                       [OK]alvindaiyan/nexus3-azure-appservice                                                   1                                       dwolla/nexus3-crowd                   Nexus3 with nexus3-crowd-plugin installed       0                                       [OK]joshdvir/nexus3                       nexus3                                          0                                       [OK]freckleiot/nexus3-oss                 A Sonatype Nexus3 OSS image which makes it e…   0                                       [OK]sdase/nexus3-base-image               An opinionated nexus3 docker image, based on…   0                                       [OK]fgbulsoni/nexus3                      My fork of the Sonatype/Nexus3 image, with a…   0                                       stocksoftware/nexus3                  A nexus3 docker instance                        0                                       [OK]lokkju/nexus3-github-auth             Sonatype Nexus 3 with Github authentication …   0                                       [OK]salte/nexus3                          Extends the Sonatype nexus3 Docker image by …   0                                       [OK]azaa1/nexus3                          Sonyatype Nexus Repository Manager 3            0                                       desiato/nexus3-ssl                    Sonatype Nexus 3 with SSL/TLS support.          0                                       [OK]mritd/nexus3                          nexus3                                          0                                       [OK]jullyannem/nexus3                     Custom image for sonatype/nexus3                0                                       bigseasre/nexus3                      mirror of the original nexus3 dockerfile        0                                       darthhater/nexus3                     A series of example Dockerfiles and images f…   0                                       [OK]nasajon/nexus3                        Nexus3                                          0                                       [OK]enieuw/nexus3-oss                     nexus3-oss                                      0                                       [OK]amribrahim00/nexus3                                                                   0
  1. 拉取nexus3镜像

docker pull docker.io/sonatype/nexus3

控制台输出

[root@xxx ~]# docker pull docker.io/sonatype/nexus3Using default tag: latestlatest: Pulling from sonatype/nexus3c65691897a4d: Pull complete 641d7cc5cbc4: Pull complete c508b13320cd: Pull complete 79e3bf9d3132: Pull complete Digest: sha256:2c33632ccd1f8c5f9023a3d7f5f541e211831e402219f8c5a83a29d1721457caStatus: Downloaded newer image for sonatype/nexus3:latestdocker.io/sonatype/nexus3:latest
  1. 查看镜像

docker images

控制台输出

[root@xxx ~]# docker imagesREPOSITORY          TAG                 IMAGE ID            CREATED             SIZEsonatype/nexus3     latest              8eb898be2a53        2 weeks ago         611MB

4.运行nexus容器

docker run -id --privileged=true --name=nexus3 --restart=always -p 8081:8081 -v /wandou/nexus3/nexus-data:/var/nexus-data sonatype/nexus3

控制台输出

[root@xxx ~]# docker run -id --privileged=true --name=nexus3 --restart=always -p 8081:8081 -v /wandou/nexus3/nexus-data:/var/nexus-data sonatype/nexus3980f3759783f3ba7e59302848f816e371b229957f2c12b8f92934d468e061b00

解释: -id 创建守护式容器 --privileged=true 授予root权限(挂载多级目录必须为true,否则容器访问宿主机权限不足) --name=名字 给你的容器起个名字 -p 宿主机端口:容器端口映射 -v 宿主机目录:容器目录 目录挂载 这里需要些许时间才能启动并访问nexus 事机器配置而定 5.访问nexus3 请先确保服务器的8081(视上面运行nexus容器时配置的端口而定)端口在安全组里已开启!!! 浏览器访问http://ip:8081 6.登录 进入nexus3页面后右上角有个登录的按钮点击显示登录框 nexus3默认的账号依旧是admin但是密码已经变了具体的密码存储在nexus3的容器的nexus-data路径内的admin.password文件内 具体操作: 1.查看nexus3容器id

docker ps

控制台显示

[root@ecs-s6-xlarge-2-linux-20190927141629 ~]# docker psCONTAINER ID        IMAGE               COMMAND                  CREATED             STATUS              PORTS                    NAMES980f3759783f        sonatype/nexus3     "sh -c ${SONATYPE_DI…"   4 minutes ago       Up 4 minutes        0.0.0.0:8081->8081/tcp   nexus3

记下CONTAINER ID:980f3759783f 2.进入容器控制台

docker exec -it 980f3759783f bash

控制台显示

[root@ecs-s6-xlarge-2-linux-20190927141629 ~]# docker exec -it 980f3759783f bashbash-4.4$ lsbin   etc     lib       lost+found  nexus-data  root  srv  uid_entrypoint.sh  varboot  help.1  lib64     media       opt         run   sys  uid_template.shdev   home    licenses  mnt         proc        sbin  tmp  usr

3.进入nexus-data文件夹

bash-4.4$ cd nexus-data/bash-4.4$ lsadmin.password  db             generated-bundles  karaf.pid  log     restore-from-backupblobs           elasticsearch  instances          keystores  orient  tmpcache           etc            javaprefs          lock       port

4.打开admin.password 文件

bash-4.4$ vi admin.password

第一行就是密码啦,复制密码用admin帐号登录,登录以后系统会自动提示你更换admin的密码


看完上述内容,你们掌握Docker中怎么安装nexus3的方法了吗?如果还想学到更多技能或想了解更多相关内容,欢迎关注行业资讯频道,感谢各位的阅读!

容器 控制台 控制 密码 登录 目录 端口 输出 宿主 宿主机 文件 镜像 内容 名字 方法 更多 权限 问题 而定 运行 数据库的安全要保护哪些东西 数据库安全各自的含义是什么 生产安全数据库录入 数据库的安全性及管理 数据库安全策略包含哪些 海淀数据库安全审计系统 建立农村房屋安全信息数据库 易用的数据库客户端支持安全管理 连接数据库失败ssl安全错误 数据库的锁怎样保障安全 广东猪兼强互联网科技有限公司 金诺互联网科技 关于新基建和互联网科技 互联网公司 科技公司 高科技与互联网 互联网科技革命 滨湖区互联网智能科技产品供应 汉立互联网科技有限公司联系电话 千方科技属于互联网企业吗 崇明区互联网教育科技售后服务 开一家科技互联网公司需要多少钱 互联网金融科技名词解释 工业互联网展湾科技股份有限公司 合肥互联网科技公司公章图片 美国互联网科技实力 上海钢联属于互联网科技股吗 深圳无忧互联网科技 广州富喜互联网络科技 新氧科技和美国互联网有关系吗 福建互联网展示科技馆设计 湖北九亚互联网络科技有限公司 互联网科技活动banner 金融科技与互联网金融 合肥互联网科技公司 广州善班互联网科技 上海亿帐通互联网科技 阿里巴巴算科技企业还是互联网 未来五年的互联网科技 哈尔滨屹滨互联网科技有限公司 领航科技大厦互联网公司
0