Sign inSign up

opcycle/nexus

By opcycle

•Updated almost 5 years ago

Sonatype Nexus Docker container image

Image
0

336

opcycle/nexus repository overview

⁠Sonatype Nexus Container Image

Docker Stars Docker Pulls

⁠Docker Images
⁠Environment Variables

When you start the Nexus image, you can adjust the configuration of the instance by passing one or more environment variables either on the docker-compose file or on the docker run command line. The following environment values are provided to custom Nexus:

VariableDefault ValueDescription
JAVA_ARGSConfigure JVM params
⁠Persisting Nexus data

If you remove the container all your data and configurations will be lost, and the next time you run the image the database will be reinitialized. To avoid this loss of data, you should mount a volume that will persist even after the container is removed.

For persistence you should mount a volume at the /opt/nexus/data path. The above examples define a docker volume namely nexus_data. The Nexus application state will persist as long as this volume is not removed.

To avoid inadvertent removal of this volume you can mount host directories as data volumes. Alternatively you can make use of volume plugins to host the volume data.

⁠Run the Service
docker service create --name nexus \
  -p 8081:8081 \
  -e JAVA_ARGS="-Xms2G -Xmx6G" \
  --mount type=bind,source=/data/nexus,destination=/opt/nexus/data \
  opcycle/nexus:latest

When running Docker Engine in swarm mode, you can use docker stack deploy to deploy a complete application stack to the swarm. The deploy command accepts a stack description in the form of a Compose file.

docker stack deploy -c nexus-stack.yml nexus

Compose file example:

version: "3.8"
services:
  nexus:
    image: opcycle/nexus:latest
    ports:
      - 8081:8081
     volumes:
      - nexus_data:/opt/nexus/data
    deploy:
      replicas: 1
      restart_policy:
        condition: on-failure
      environment:
        - JAVA_ARGS=-Xms2G -Xmx6G

volumes:
  nexus_data:
    driver: local
    driver_opts:
      type: "none"
      o: "bind"
      device: "/data/nexus"

⁠Contributing

We'd love for you to contribute to this container. You can request new features by creating an issue⁠, or submit a pull request⁠ with your contribution.

⁠Issues

If you encountered a problem running this container, you can file an issue⁠. For us to provide better support, be sure to include the following information in your issue:

  • Host OS and version
  • Docker version
  • Output of docker info
  • Version of this container
  • The command you used to run the container, and any relevant output you saw (masking any sensitive information)

Tag summary

Content type

Image

Digest

Size

349.8 MB

Last updated

almost 5 years ago

docker pull opcycle/nexus