[root@VM-16-9-centos docker-compose]# cat docker-compose.yml
version: '3.7'
services:
nexus:
restart: always
image: sonatype/nexus3
container_name: nexus3
environment:
INSTALL4J_ADD_VM_PARAMS: -XX:ActiveProcessorCount=2 # CPU数
ports:
- 8081:8081
volumes:
- /data/nexus:/nexus-data # /data/nexus要给777权限
[root@VM-16-9-centos docker-compose]# docker-compose -f docker-compose.yml up -d
[root@VM-16-9-centos docker-compose]# docker-compose ps
NAME COMMAND SERVICE STATUS PORTS
nexus3 "sh -c ${SONATYPE_DI…" nexus running 0.0.0.0:8081->8081/tcp, :::8081->8081/tcp
密码在/data/nexus/admin.password 中
启动出问题:docker logs -f nexus3