创建数据目录

mkdir -pv /data/nexus/nexus-data && chown -R 200 /data/nexus/nexus-data

docker-compose.yaml

version: '3'

services:
  nexus3:
    image: sonatype/nexus3:3.66.0
    container_name: nexus3
    restart: always
    environment:
      - TZ=Asia/Shanghai
      # - INSTALL4J_ADD_VM_PARAMS="-Xms2703m -Xmx2703m -XX:MaxDirectMemorySize=2703m
    networks:
      nexus-bridge:
    ports:
      - 8081:8081
    volumes:
      - ./nexus-data:/nexus-data


networks:
  nexus-bridge:
    driver: bridge

运行 nexus

docker compose up -d
[+] Running 1/1
 ✔ Container nexus3  Started

查看运行状态

docker ps
CONTAINER ID   IMAGE                    COMMAND                  CREATED              STATUS              PORTS                                       NAMES
ac1863d5cab6   sonatype/nexus3:latest   "/opt/sonatype/nexus…"   About a minute ago   Up About a minute   0.0.0.0:8081->8081/tcp, :::8081->8081/tcp   nexus3

访问 dashboard

访问地址: http://ip:8081

docker compose 部署 nexus3_docker

docker compose 部署 nexus3_docker_02

docker compose 部署 nexus3_3d_03

docker compose 部署 nexus3_docker_04

docker compose 部署 nexus3_数据目录_05

docker compose 部署 nexus3_3d_06

docker compose 部署 nexus3_docker_07

参考文档

https://help.sonatype.com/en/installation-methods.html