Public | Automated Build

Last pushed: 6 months ago
Short Description
Nexus 3
Full Description

nexus

A Dockerfile for Sonatype Nexus Repository Manager 3, based on Alpine.

To run, binding the exposed port 8081 to the host.

$ docker run -d -p 8081:8081 -p 5000:5000 --name nexus dblk/nexus3

Notes

  • Default credentials are: admin / admin123

  • Port 5000 is used in case of docker hosted registry because it needs an additional port

  • It can take some time (2-3 minutes) for the service to launch in a
    new container. You can tail the log to determine once Nexus is ready:

$ docker logs -f nexus
  • Installation of Nexus is to /opt/sonatype/nexus.

  • A persistent directory, /nexus-data, is used for configuration,
    logs, and storage.

  • Two environment variables can be used to control the JVM arguments

    • JAVA_MAX_MEM, passed as -Xmx. Defaults to 1200m.

    • JAVA_MIN_MEM, passed as -Xms. Defaults to 1200m.

    These can be used supplied at runtime to control the JVM:

    $ docker run -d -p 8081:8081 -p 5000:5000 --name nexus -e JAVA_MAX_MEM=2048M dblk/nexus3
    

SSL

If you want to run Nexus in SSL, you need to create a Java keystore file with your certificate. See the Jetty documentation for help.

You will need to mount your keystore to the appropriate directory and pass in the keystore password as well.

$ docker run -d -p 8443:8443 -p 5000:5000 --name nexus -v /path/to/your-keystore.jks:/nexus-data/keystore.jks -e JKS_PASSWORD="changeit" dblk/nexus3

Nexus will now serve its' UI on HTTPS on port 8443 and redirect HTTP requests to HTTPS.

Persistent Data

There are two general approaches to handling persistent storage requirements
with Docker. See Managing Data in Containers
for additional information.

  1. Use a data volume container. Since data volumes are persistent
    until no containers use them, a container can created specifically for
    this purpose. This is the recommended approach.

    $ docker run -d --name nexus-data clearent/nexus echo "data-only container for Nexus"
    $ docker run -d -p 8081:8081 -p 5000:5000 --name nexus --volumes-from nexus-data dblk/nexus3
    
  2. Mount a host directory as the volume.

    $ docker run -d -p 8081:8081 -p 5000:5000 --name nexus -v /some/dir/nexus-data:/nexus-data dblk/nexus3
    
Docker Pull Command
Owner
dblk
Source Repository

Comments (0)