OCI Artifact - Deploy directly from GitHub Container Registry
Sonatype Nexus Repository Manager is a universal artifact repository that supports Maven, npm, Docker, PyPI, and many other package formats. This stack provides a production-ready Nexus 3 instance with Traefik integration.
This is a Docker Compose OCI artifact, not a traditional Docker image. It contains a complete docker-compose.yml configuration that you can deploy directly using Docker 25.0+.
# 1. Create environment file
cat > .env.nexus << 'EOF'
COMPOSE_PROJECT_NAME=nexus
SERVICE_DOMAIN=nexus.example.com
NEXUS_VERSION=3.88.0-alpine
EOF
# 2. Deploy
bc nexus up
# 3. Check status
bc nexus psNote: Install the bc CLI with:
curl -fsSL https://raw.githubusercontent.com/beevelop/beecompose/main/scripts/install.sh | sudo bash
# 1. Create environment file
cat > .env.nexus << 'EOF'
COMPOSE_PROJECT_NAME=nexus
SERVICE_DOMAIN=nexus.example.com
NEXUS_VERSION=3.88.0-alpine
EOF
# 2. Deploy from GHCR
docker compose -f oci://ghcr.io/beevelop/nexus:latest --env-file .env.nexus up -d --pull always
# 3. Check status
docker compose -f oci://ghcr.io/beevelop/nexus:latest --env-file .env.nexus ps- Docker 25.0+ (required for OCI artifact support)
- Docker Compose v2.24+
- Traefik reverse proxy (see traefik)
| Container | Image | Purpose |
|---|---|---|
| nexus | sonatype/nexus3:3.88.0-alpine | Nexus Repository Manager |
| Variable | Description | Example |
|---|---|---|
SERVICE_DOMAIN |
Domain for Traefik routing | nexus.example.com |
| Variable | Description | Default |
|---|---|---|
COMPOSE_PROJECT_NAME |
Docker Compose project name | nexus |
NEXUS_VERSION |
Nexus image version | 3.88.0-alpine |
| Volume | Purpose |
|---|---|
nexus_data |
Nexus data, blobs, and configuration (/nexus-data) |
On first startup, Nexus generates a random admin password:
# Retrieve initial admin password
docker exec nexus cat /nexus-data/admin.password- Navigate to
https://nexus.example.com - Click "Sign In" in the top right
- Login with username
adminand the password from above - Complete the setup wizard to set a new password and configure anonymous access
Common repository configurations:
- Maven: Create hosted, proxy (Maven Central), and group repositories
- npm: Create proxy to npmjs.org
- Docker: Create hosted registry and configure Docker client
bc nexus logs -f # View logs
bc nexus restart # Restart
bc nexus down # Stop
bc nexus update # Pull and recreate# Define alias for convenience
alias dc="docker compose -f oci://ghcr.io/beevelop/nexus:latest --env-file .env.nexus"
# View logs
dc logs -f
# Restart
dc restart
# Stop
dc down
# Update
dc pull && dc up -dNexus can take 2-3 minutes to start. The healthcheck has a 120-second start period to accommodate this.
Nexus requires significant memory. Consider adding memory limits or increasing host RAM if experiencing OOM issues.
Check logs with dc logs nexus and ensure all required environment variables are set.