介绍
搭建Nexus私服的主要目的是为了解决工作上组件之间的jar包依赖管理。
特别是基础架构部门的jar包要共享出来,就需要把jar包deploy发布到nexus私服上。
Compose准备
docker-compose.yml
version: "3.5"
services:
nexus-server:
image: sonatype/nexus3
container_name: nexus3
ports:
- 8081:8081
volumes:
- /etc/timezone:/etc/timezone:ro
- /usr/share/zoneinfo/Asia/Shanghai:/etc/localtime:ro
- /opt/nexus/nexus-data:/nexus-data
restart: always
启动容器
#挂载文件授权
mkdir -p /opt/nexus/nexus-data && chown -R 200:200 /opt/nexus/nexus-data
#时区设置
echo "Asia/Shanghai" > /etc/timezone
#在compose文件所在目录启动
docker-compose up -d
初次登录修改密码
#查看默认密码,默认用户名admin
cat /opt/nexus/nexus-data/admin.password