docker搭建maven 私服 -- nexus

1.准备

  • 一台可以上网的centos7服务器并安装有docker

2.查找镜像

docker search nexus

3.选取第一个镜像拉取

docker pull sonatype/nexus3

4.查看拉取的镜像

docker images

5.启动nexus镜像

docker run -p 5000:5000 -p 8081:8081 --name nexus \
--restart=always \
-v /opt/nexus-data:/nexus-data \
-d --hostname nexus sonatype/nexus3
  • 默认密码 : admin/admin123
  • 参数解释
5000端口是用于镜像仓库的服务端口   
8081 端口是nexus的服务端口

6.查看容器日志

docker logs nexus

Nexus 3.x 镜像权限问题

  • 问题
[root@localhost opt]# docker logs nexus
mkdir: cannot create directory '../sonatype-work/nexus3/log': Permission denied
mkdir: cannot create directory '../sonatype-work/nexus3/tmp': Permission denied
Java HotSpot(TM) 64-Bit Server VM warning: Cannot open file ../sonatype-work/nexus3/log/jvm.log due to No such file or directory
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
  • 解决方法
#将目录权限归属设定为 200
chown -R 200 /opt/nexus-data/

最新的Nexus 3.x还支持Docker仓库


  • 当才华还配不上野心,就静下来学习
  • blog地址:https://starsea.51vip.biz
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值