跳至主要内容

Nexus

Overview

This installation happens on the dsb-hub.

Nexus Repository Manager is a tool for managing components and build artifacts across various formats like Docker, Maven, and npm. We are using Docker Compose to install Nexus to avoid conflicts with SonarQube's JDK requirements. Nexus will be used to manage Docker images, allowing us to proxy images from Docker Hub, cache them locally, and securely manage retrieval.

Installation Steps

  1. Create a new directory for Nexus:

    mkdir -p apps/nexus/nexus-data
    sudo chown -R 200 apps/nexus/nexus-data
  2. Create the Docker Compose YAML file:

    cd apps/nexus
    touch docker-compose.yml
  3. Add the following content to the docker-compose.yml:

    version: "3"
    services:
    nexus:
    image: sonatype/nexus3
    restart: always
    volumes:
    - "./nexus-data:/nexus-data"
    ports:
    - "8081:8081"
    - "8082:8082"
    - "8085:8085"
    volumes:
    nexus-data:
    driver: local
  4. Run the application:

    docker compose up -d
  5. Confirm that the application is up and running by visiting:

    http://your-ip-address:8081

Nexus is live

Configuration Steps

  1. Click the "Sign In" button and locate the admin password:

    cat nexus-data/admin.password

    Admin Password

  2. Use the password to log in and complete the initial setup:

    • Change your password.
    • Enable anonymous access if desired.

    Login

  3. As admin, navigate to the UI and create a new repository: Create Repository

  4. For the new repository, choose "Docker proxy" and input the following information:

    1. Name: docker-proxy
    2. Remote Storage Proxy URL: https://registry.hub.docker.com
    3. Docker Index: Docker Hub
    4. Enable anonymous pulls.
    5. Set HTTP to 8082.
  5. Create a local user with the username nx-anonymous and complete the setup:

    Create User

You're Done!

You've successfully set up your Nexus server.