• Stars
    star
    383
  • Rank 111,995 (Top 3 %)
  • Language
    Dockerfile
  • License
    Other
  • Created almost 10 years ago
  • Updated about 2 years ago

Reviews

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

Repository Details

Docker image for Sonatype Nexus

sonatype/docker-nexus

Docker images for Sonatype Nexus Repository Manager 2 with the OpenJDK, starting with 2.14.14 the Red Hat Universal Base Image is used as the base image while earlier versions used CentOS. For Nexus Repository Manager 3, please refer to https://github.com/sonatype/docker-nexus3

To build:

# docker build --rm --tag sonatype/nexus oss/
# docker build --rm --tag sonatype/nexus-pro pro/

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

# docker run -d -p 8081:8081 --name nexus sonatype/nexus:oss

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=sonatype/nexus .

Notes

  • The UI is accessible at: http://localhost: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 ./conf/jetty-http.xml

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

    $ docker run -d -p 8081:8081 --name nexus -e MAX_HEAP=768m sonatype/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 sonatype/nexus echo "data-only container for Nexus"
$ docker run -d -p 8081:8081 --name nexus --volumes-from nexus-data sonatype/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 sonatype/nexus

Adding Nexus Plugins

Creating a docker image based on sonatype/nexus is the suggested process: plugins should be expanded to /opt/sonatype/nexus/nexus/WEB-INF/plugin-repository. See #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:

More Repositories

1

nexus-public

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

docker-nexus3

Dockerized version of Nexus Repo Manager 3
Groovy
1,418
star
3

nexus-oss

Sonatype Nexus OSS
258
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
173
star
6

helm3-charts

Helm3 charts for Nexus IQ
Shell
110
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
84
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

nxrm3-ha-repository

Repository for YAML configuration files for Nexus Repository Manager High Availability Feature
Mustache
20
star
34

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
35

maven-cookbook

Maven Cookbook
CSS
18
star
36

m2eclipse-book

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

operator-nxrm3

IBM Operator for Nexus Repo Manager 3
Shell
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

ossindex-maven

Sonatype OSS Index - Maven Integrations
Java
11
star
49

nxrm3-maven-plugin

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