• Stars
    star
    1,407
  • Rank 33,328 (Top 0.7 %)
  • Language
    Groovy
  • License
    Apache License 2.0
  • Created over 8 years ago
  • Updated about 1 month ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Dockerized version of Nexus Repo Manager 3

Sonatype Nexus Repository Docker: sonatype/nexus3

Join the chat at https://gitter.im/sonatype/nexus-developers

A Dockerfile for Sonatype Nexus Repository 3, starting with 3.18 the image is based on the Red Hat Universal Base Image while earlier versions used CentOS.

Contribution Guidelines

Go read our contribution guidelines to get a bit more familiar with how we would like things to flow.

Running

To run, binding the exposed port 8081 to the host, use:

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

When stopping, be sure to allow sufficient time for the databases to fully shut down.

docker stop --time=120 <CONTAINER_NAME>

To test:

$ curl http://localhost:8081/

Building the Sonatype Nexus Repository image

To build a docker image from the Dockerfile you can use this command:

$ docker build --rm=true --tag=sonatype/nexus3 .

The following optional variables can be used when building the image:

  • NEXUS_VERSION: Version of the Sonatype Nexus Repository
  • NEXUS_DOWNLOAD_URL: Download URL for Sonatype Nexus Repository, alternative to using NEXUS_VERSION to download from Sonatype
  • NEXUS_DOWNLOAD_SHA256_HASH: Sha256 checksum for the downloaded Sonatype Nexus Repository archive. Required if NEXUS_VERSION or NEXUS_DOWNLOAD_URL is provided

Chef Solo for Runtime and Application

Chef Solo is used to build out the runtime and application layers of the Docker image. The Chef cookbook being used is available on GitHub at sonatype/chef-nexus-repository-manager.

Testing the Dockerfile

We are using rspec as the test framework. serverspec provides a docker backend (see the method set in the test code) to run the tests inside the docker container, and abstracts away the difference between distributions in the tests (e.g. yum, apt,...).

rspec [--backtrace] spec/Dockerfile_spec.rb

Red Hat Certified Image

A Red Hat certified container image can be created using Dockerfile.rh.ubi which is built to be compliant with Red Hat certification. The image includes additional meta data to comform with Kubernetes and OpenShift standards, a directory with the licenses applicable to the software and a man file for help on how to use the software. It also uses an ENTRYPOINT script the ensure the running user has access to the appropriate permissions for OpenShift 'restricted' SCC.

The Red Hat certified container image is available from the Red Hat Container Catalog and qualified accounts can pull it from registry.connect.redhat.com.

Other Red Hat Images

In addition to the Universal Base Image, we can build images based on:

Notes

  • Our system requirements should be taken into account when provisioning the Docker container.

  • Default user is admin and the uniquely generated password can be found in the admin.password file inside the volume. See Persistent Data for information about the volume.

  • 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. This directory needs to be writable by the Nexus process, which runs as UID 200.

  • There is an environment variable that is being used to pass JVM arguments to the startup script

    • INSTALL4J_ADD_VM_PARAMS, passed to the Install4J startup script. Defaults to -Xms2703m -Xmx2703m -XX:MaxDirectMemorySize=2703m -Djava.util.prefs.userRoot=${NEXUS_DATA}/javaprefs.

    This can be adjusted at runtime:

    $ docker run -d -p 8081:8081 --name nexus -e INSTALL4J_ADD_VM_PARAMS="-Xms2703m -Xmx2703m -XX:MaxDirectMemorySize=2703m -Djava.util.prefs.userRoot=/some-other-dir" sonatype/nexus3
    

    Of particular note, -Djava.util.prefs.userRoot=/some-other-dir can be set to a persistent path, which will maintain the installed Sonatype Nexus Repository License if the container is restarted.

    Be sure to check the memory requirements when deciding how much heap and direct memory to allocate.

  • Another environment variable can be used to control the Nexus Context Path

    • NEXUS_CONTEXT, defaults to /

    This can be supplied at runtime:

    $ docker run -d -p 8081:8081 --name nexus -e NEXUS_CONTEXT=nexus sonatype/nexus3
    

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 docker volume. Since docker volumes are persistent, a volume can be created specifically for this purpose. This is the recommended approach.
$ docker volume create --name nexus-data
$ docker run -d -p 8081:8081 --name nexus -v nexus-data:/nexus-data sonatype/nexus3
  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 specific 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:/nexus-data sonatype/nexus3

Getting Help

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

License Disclaimer

Sonatype Nexus Repository OSS is distributed with Sencha Ext JS pursuant to a FLOSS Exception agreed upon between Sonatype, Inc. and Sencha Inc. Sencha Ext JS is licensed under GPL v3 and cannot be redistributed as part of a closed source work.

More Repositories

1

nexus-public

Sonatype Nexus Repository Open-source codebase mirror
Java
1,856
star
2

docker-nexus

Docker image for Sonatype Nexus
Dockerfile
383
star
3

nexus-oss

Sonatype Nexus OSS
259
star
4

maven-example-en

Maven: By Example
CSS
175
star
5

nexus-book-examples

Example projects and other resources for the book Repository Management with Nexus
Shell
171
star
6

helm3-charts

Helm3 charts for Nexus IQ
Shell
109
star
7

m2eclipse-scala

Java
108
star
8

nexus

Java
96
star
9

maven-guide-zh

Maven: The Definitive Guide (Chinese)
Java
86
star
10

nexus-maven-plugins

Nexus Maven Plugins
Java
83
star
11

nexus-book

Repository Management with Nexus
XSLT
83
star
12

maven-reference-en

Maven: The Complete Reference
CSS
82
star
13

sonatype-tycho

Java
79
star
14

sonatype-aether

DEPRECATED: This project moved to Eclipse, please follow the link below to find the new sources.
Java
67
star
15

nexus-blobstore-s3

[*No longer maintained*] Nexus Repository S3 Blobstores
Java
58
star
16

chef-nexus-repository-manager

Chef recipes for Nexus Repository Manager
Ruby
45
star
17

JGit

JGit
Java
39
star
18

codestyle

The Sonatype Code Style Guide
Java
35
star
19

nxrm3-helm-repository

Helm3 charts for Nexus Repository Manager
Shell
33
star
20

oss-parents

Sonatype OSS Parent poms
31
star
21

nexus-ruby-support

26
star
22

nexus-presentations

Presentations and labs about the Sonatype Nexus repository manager and Nexus Lifecycle
HTML
26
star
23

plexus-classworlds

Java
25
star
24

plexus-archiver

Java
25
star
25

plexus-utils

Java
25
star
26

jarjar-maven-plugin

Repackage and embed dependencies
Java
25
star
27

nexus-example-plugins

Nexus example plugins
Java
24
star
28

sisu-guice

Patched build of Google Guice
Java
24
star
29

docker-nexus-iq-server

Dockerized version of Nexus IQ Server
Slim
24
star
30

sisu

JSR 330 based container and Plexus adapter
Java
21
star
31

maven-guide-en

Maven: The Definitive Guide (English)
Java
21
star
32

plexus-compiler

Java
20
star
33

sonatype-react-shared-components

The Shared Component Library is a set of components written in React, HTML, and CSS. The library provides development teams consistent, Sonatype-branded components that ensure that our applications have a common UI/UX.
TypeScript
20
star
34

maven-cookbook

Maven Cookbook
CSS
18
star
35

m2eclipse-book

This is a book about m2eclipse: The maven plugin for Eclipse
CSS
17
star
36

operator-nxrm3

IBM Operator for Nexus Repo Manager 3
Shell
16
star
37

nxrm3-ha-repository

Repository for YAML configuration files for Nexus Repository Manager High Availability Feature
Mustache
16
star
38

artifact-resolver

Standalone jar executable client Maven 2 artifact resolver based on Eclipse Aether.
Groovy
14
star
39

aether-demo-maven-plugin

A simple Maven plugin demonstrating the use of Aether.
Java
13
star
40

tycho-jnlp-plugin

Java
13
star
41

package-url-java

Java Package URL implementation
Java
12
star
42

nexus-gem

Ruby
12
star
43

bower-nexus3-resolver

A custom Bower resolver to communicate with Nexus 3.
JavaScript
12
star
44

plexus-containers

Java
12
star
45

install4j-support

Install4j Support
Java
11
star
46

tycho-extras

Java
11
star
47

docker-rhel-nexus

OpenShift Dockerfiles, templates and scripts to run Nexus Repository Manager
Roff
11
star
48

nxrm3-maven-plugin

Java
10
star
49

ossindex-maven

Sonatype OSS Index - Maven Integrations
Java
10
star
50

hudson-jsr330

JSR-330 integration for Hudson.
Java
8
star
51

women-at-sonatype

This list aims to highlight members of W@S and their expertise, along with an opportunity to connect with them based on their interests.
8
star
52

goodies

Goodies
Java
7
star
53

RestSimple

Java
7
star
54

http-testing-harness

Testing library for Junit3/4 and TestNG for handling multiple server fixture setups for test methods.
Java
7
star
55

modello

Java
7
star
56

nxrm-sample-files-repo

Repository for YAML configuration files for Nexus Repository Manager
Dockerfile
7
star
57

plexus-cipher

Java
6
star
58

munge-maven-plugin

Simple Java preprocessor
Java
6
star
59

port-allocator-maven-plugin

Java
6
star
60

p2-bridge

Java
6
star
61

nexus-perf

Nexus Performance Testing Library
Java
6
star
62

ossindex-public

Sonatype OSS Index - Public
Java
6
star
63

nexus-bundle-maker-plugin

Java
6
star
64

actions

Public repository to keep Sonatype's GitHub Actions.
6
star
65

nexus-ant-tasks

Nexus Ant Tasks
Java
6
star
66

patched-xfire

A custom patched version of xfire
Java
5
star
67

jgit-simple

Java
5
star
68

emma-maven-plugin

Java
5
star
69

AsyncHttpClient-Test-Suite

Extensive Test Suite for AsyncHttpClient library
Java
5
star
70

ui-gallery

Gallery for current styles for Sonatype user interfaces. Includes reusable HTML/SCSS.
HTML
4
star
71

sshjgit

Java
4
star
72

nexus-plugin-bundle

Java
4
star
73

onboarding

Java
4
star
74

emma4it-maven-plugin

Java
4
star
75

sonatype-peaberry

Java
4
star
76

dropwizard-support

Goodies: Dropwizard Support
Java
4
star
77

nxrm3-preview-ha-repository

Repository for YAML configuration files for preview Nexus Repository Manager High Availability Feature
4
star
78

nexus-ivy-support

Java
3
star
79

jsw-binaries

Java Service Wrapper (JSW) binaries, used by NXRM 2
Shell
3
star
80

tycho-book

Book about Tycho
Shell
3
star
81

simple-example

Simple Example from Maven by Example
Java
3
star
82

sisu-maven-bridge

Java
3
star
83

sisu-litmus

Sisu Litmus, test support components
Java
3
star
84

cometd-asynchttpclient

Bayeux client powered by AsyncHttpClient
Java
3
star
85

plexus-io

Java
3
star
86

plexus-interpolation

Java
3
star
87

sonatype-ci-for-jenkins

Java
3
star
88

wagon-jetty

Java
3
star
89

attach-artifact-maven-plugin

Java
2
star
90

cobertura4it-maven-plugin

Java
2
star
91

chef-nexus-iq-server

Chef recipes for Nexus IQ Server
Ruby
2
star
92

sisu-maven-plugin

Manage Sisu components and applications
Java
2
star
93

maven-assembly-helpers

Java
2
star
94

directjngine

DirectJNgine -- maintenance fork
Java
2
star
95

nexus-iq-fortify-ssc

Repository to share Fortify-SSC Integration artifacts
2
star
96

spice-zapper

Java
2
star
97

learn-k8s-master

Collaboration template repository to support the K8s Fluency Channel on Pluralsight
2
star
98

homebrew-nexus-iq-cli

Ruby
2
star
99

sonatype-bundle-plugin

2
star
100

sisu-build-api

Java
2
star