GithubHelp home page GithubHelp logo

dockerfile-nexus's Introduction

Sonatype Nexus

Docker images for Sonatype Nexus Repository Manager 2 with the Oracle JDK.

Inspiration: https://github.com/sonatype/docker-nexus

To build:

# docker build --rm --tag stakater/nexus .

To run (if port 8081 is open on your host):

# docker run -d -p 8081:8081 --name nexus stakater/nexus

To determine the port that the container is listening on:

# docker ps -l

To test:

$ curl http://localhost:8081/nexus/service/local/status

To build, copy the Dockerfile and do the build:

$ docker build --rm=true --tag=stakater/nexus .

Notes

  • URL to access nexus UI is http://server:8081/nexus

  • Default credentials are: admin / admin123

  • 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. Notably: /opt/sonatype/nexus/conf/nexus.properties is the properties file. Parameters (nexus-work and nexus-webapp-context-path) defined here are overridden in the JVM invocation.

  • A persistent directory, /sonatype-work, is used for configuration, logs, and storage. This directory needs to be writeable by the Nexus process, which runs as UID 200.

  • Environment variables can be used to control the JVM arguments

    • CONTEXT_PATH, passed as -Dnexus-webapp-context-path. This is used to define the URL which Nexus is accessed. Defaults to '/nexus'
    • MAX_HEAP, passed as -Xmx. Defaults to 768m.
    • MIN_HEAP, passed as -Xms. Defaults to 256m.
    • JAVA_OPTS. Additional options can be passed to the JVM via this variable. Default: -server -XX:MaxPermSize=192m -Djava.net.preferIPv4Stack=true.
    • LAUNCHER_CONF. A list of configuration files supplied to the Nexus bootstrap launcher. Default: ./conf/jetty.xml ./conf/jetty-requestlog.xml

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

    $ docker run -d -p 8081:8081 --name nexus -e MAX_HEAP=768m stakater/nexus
    

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 be created specifically for this purpose. This is the recommended approach.
$ docker run -d --name nexus-data stakater/nexus echo "data-only container for Nexus"
$ docker run -d -p 8081:8081 --name nexus --volumes-from nexus-data stakater/nexus
  1. Mount a host directory as the volume. This is not portable, as it relies on the directory existing with correct permissions on the host. However it can be useful in certain situations where this volume needs to be assigned to certain underlying storage.
$ mkdir /some/dir/nexus-data && chown -R 200 /some/dir/nexus-data
$ docker run -d -p 8081:8081 --name nexus -v /some/dir/nexus-data:/sonatype-work stakater/nexus

Adding Nexus Plugins

Creating a docker image based on stakater/nexus is the suggested process: plugins should be expanded to /opt/sonatype/nexus/nexus/WEB-INF/plugin-repository. See sonatype/docker-nexus#9 for an example concerning the Nexus P2 plugins.

Build Args

Each Dockerfile contains two build arguments (NEXUS_VERSION & NEXUS_DOWNLOAD_URL) that can be used to customize what version of, and from where, Nexus Repository Manager is downloaded. This is useful mostly for testing purposes as the Dockerfile may be dependent on a very specific version of Nexus Repository Manager.

docker build --rm --tag nexus-custom-oss --build-arg NEXUS_VERSION=2.x.y --build-arg NEXUS_DOWNLOAD_URL=http://.../nexus-2.x.y-bundle.tar.gz oss/
docker build --rm --tag nexus-custom-pro --build-arg NEXUS_VERSION=2.x.y --build-arg NEXUS_DOWNLOAD_URL=http://.../nexus-professional-2.x.y-bundle.tar.gz pro/

Getting Help

Looking to contribute to our Docker image but need some help? There's a few ways to get information or our attention:

dockerfile-nexus's People

Contributors

hazim1093 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.