docker nexus3
环境 centos7
查找nexus3镜像
[root@localhost ~]# docker search nexus3
INDEX NAME DESCRIPTION STARS OFFICIAL AUTOMATED
docker.io docker.io/sonatype/nexus3 Sonatype Nexus Repository Manager 3 822
docker.io docker.io/shifudao/nexus3 clone from nexus3 image but based from ope... 4 [OK]
docker.io docker.io/home1oss/nexus3 An auto configured nexus3 2 [OK]
安装并运行镜像
[root@localhost ~]# docker pull docker.io/sonatype/nexus3
[root@localhost ~]# mkdir /data/nexus3-data
[root@localhost ~]# chmod 777 /data/nexus3-data
[root@localhost ~]# docker run -d --name nexus3 \
--restart=always \
--privileged=true \
-p 8081:8081 \
-p 8082:8082 \
-p 8083:8083 \
-p 8084:8084 \
-p 8085:8085 \
-v /data/nexus3-data:/nexus-data \
docker.io/sonatype/nexus3
访问并登录:
注意:放开端口或者关闭防火墙
systemctl stop firewalld
http://centoshost:8081/
[root@localhost nexus3-data]# ls /data/nexus3-data
admin.password elasticsearch javaprefs log tmp
blobs etc karaf.pid orient
cache generated-bundles keystores port
db instances lock restore-from-backup
admin.password
里面记录了密码,用户名admin
登录后系统要求我们修改密码,我把密码修改为 admin123
修改密码后,系统会把文件admin.password
删除
创建私库
把jar包上传到私库
设置maven的setting.xml, 增加server配置
<servers>
<server>
<id>maven-my-release</id>
<username>admin</username>
<password>admin123</password>
</server>
</servers>
在window上使用maven命令上传jar包到私库
F:\tmp> mvn deploy:deploy-file -DgroupId=com.sky ^
-DartifactId=user ^
-Dversion=1.0 ^
-Dpackaging=jar ^
-Dfile=user.jar ^
-DrepositoryId=maven-my-release ^
-Durl=http://centoshost:8081/repository/maven-my-release/
备注:^
是cmd窗口的换行符
上传成功后,在nexus3上查看