1. [root@VM-16-9-centos docker-compose]# cat docker-compose.yml
    2. version: '3.7'
    3. services:
    4. nexus:
    5. restart: always
    6. image: sonatype/nexus3
    7. container_name: nexus3
    8. environment:
    9. INSTALL4J_ADD_VM_PARAMS: -XX:ActiveProcessorCount=2 # CPU数
    10. ports:
    11. - 8081:8081
    12. volumes:
    13. - /data/nexus:/nexus-data # /data/nexus要给777权限
    14. [root@VM-16-9-centos docker-compose]# docker-compose -f docker-compose.yml up -d
    15. [root@VM-16-9-centos docker-compose]# docker-compose ps
    16. NAME COMMAND SERVICE STATUS PORTS
    17. 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