美文网首页
Dokcer搭建maven私有服务器-nexus3

Dokcer搭建maven私有服务器-nexus3

作者: 小迷糊紫靈 | 来源:发表于2019-10-01 20:13 被阅读0次

1、拉取镜像

docker pull sonatype/nexus3 

2、创建资源目录

mkdir nexus-data 

3、向资源目录授权

chown -R 200 nexus-data

4、创建容器

docker run -d --name nexus3 --restart=always -v /指定目录地址/nexus-data:/nexus-data sonatype/nexus3

执行完成命令之后 nexus3应该就能正常启动,但是无法通过外网访问。后期可以通过配置nginx或者apache等进行端口指向完成外网访问。同时也可以加上参数:-p 8081:8081 进行端口指向。

5、搭建完成的时候可能会出现无法启动的问题

docker: Error response from daemon: OCI runtime create failed: container_linux.go:344: starting container process caused "process_linux.go:293: copying bootstrap data to pipe caused \"write init-p: broken pipe\"": unknown.

此时我们需要使用update还更新我们的系统,并且重启系统完成更新。
注意一点,如果我们没有进行授权会出现项目无限重启

CONTAINER ID        IMAGE               COMMAND                  CREATED             STATUS                                    PORTS               NAMES
bee1d877be16        sonatype/nexus3     "sh -c ${SONATYPE_DI…"   2 hours ago         Restarting (255) Less than a second ago                       nexus3

此时我们使用docker logs nexus3查看容器异常信息的时候会看到:

Warning:  Cannot open log file: ../sonatype-work/nexus3/log/jvm.log
Warning:  Forcing option -XX:LogFile=/tmp/jvm.log
Unable to update instance pid: Unable to create directory /nexus-data/instances
/nexus-data/log/karaf.log (No such file or directory)
Unable to update instance pid: Unable to create directory /nexus-data/instances
mkdir: cannot create directory '../sonatype-work/nexus3/log': Permission denied
mkdir: cannot create directory '../sonatype-work/nexus3/tmp': Permission denied
OpenJDK 64-Bit Server VM warning: Cannot open file ../sonatype-work/nexus3/log/jvm.log due to No such file or directory

的异常信息,此时关闭容器并对资源目录授权就可以解决。

相关文章

  • maven备忘

    1. 搭建私有库 使用docker搭建私有maven库,docker image为sonatype/nexus3 ...

  • Dokcer搭建maven私有服务器-nexus3

    1、拉取镜像 2、创建资源目录 3、向资源目录授权 4、创建容器 执行完成命令之后 nexus3应该就能正常启动,...

  • docker补充(一)

    1.dokcer 私有仓库搭建 2.docker maven插件 2.1修改宿主机的配置,让其可以远程访问 2.2...

  • Nexus3 私服的使用

    一、下载与安装 Maven Nexus3私服搭建指南,点击查看 二、Maven配置 打开Maven配置文件 set...

  • 8 私服相关

    1 私服:nexus搭建流程Maven Nexus3私服搭建指南https://www.jianshu.com/p...

  • Kubernetes部署Nexus3

    Kubernetes部署Nexus3 重点参考kubernetes集群:nexus搭建docker私有仓库及使用 ...

  • Android 打包上传Maven私库

    一.Maven私服搭建 下载nexus3地址:https://www.sonatype.com/download-...

  • Android 打包上传Maven库

    一.Maven私服搭建 下载nexus3地址:https://www.sonatype.com/download-...

  • 私有npm服务器搭建

    私有npm服务器搭建 标签(空格分隔): Node.js 私有npm服务器搭建 本次搭建是在ubuntu环境下搭建...

  • 搭建私有npm服务器教程

    私有npm服务器搭建 标签(空格分隔): Node.js 私有npm服务器搭建 本次搭建是在ubuntu环境下搭建...

网友评论

      本文标题:Dokcer搭建maven私有服务器-nexus3

      本文链接:https://www.haomeiwen.com/subject/qnzkpctx.html