Compare commits
35 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 9ee35fedf9 | |||
| 1d3a2851a9 | |||
| a9fe8de83e | |||
| 338e9dfcff | |||
| 14a5413d9e | |||
| cd24b0ade1 | |||
| e893e36611 | |||
| abac465289 | |||
| 3c7173fb66 | |||
| 222feb87e9 | |||
| acfe030b2c | |||
| be84bce298 | |||
| f9971ab0c0 | |||
| 469ac29f7d | |||
| 381241b6ae | |||
| 3be88b6f4f | |||
| f4b78f48b1 | |||
| b8cddf1c63 | |||
| 4beac47b22 | |||
| 88aaa11b5d | |||
| 06998bb28f | |||
| cd97ed93ac | |||
| 17da9bc447 | |||
| b4835eee02 | |||
| 68f8d092db | |||
| b8061cd565 | |||
| 3139f9340a | |||
| 255a50947d | |||
| 861ceb376d | |||
| 3566cd9ab0 | |||
| eef5f067e2 | |||
| e651dd9cf8 | |||
| 33fbccb149 | |||
| 4ce0b109aa | |||
| 482cba3956 |
+25
@@ -0,0 +1,25 @@
|
||||
# Eclipse
|
||||
.classpath
|
||||
.project
|
||||
.settings/
|
||||
|
||||
# Maven
|
||||
target/
|
||||
*.ser
|
||||
*.ec
|
||||
.mvn/timing.properties
|
||||
|
||||
# Intellij
|
||||
*.ipr
|
||||
*.iml
|
||||
*.iws
|
||||
.idea/
|
||||
|
||||
# Other
|
||||
.DS_Store
|
||||
.clover
|
||||
*.log
|
||||
/*.rc
|
||||
atlassian-ide-plugin.xml
|
||||
dependency-reduced-pom.xml
|
||||
out
|
||||
+49
-25
@@ -1,19 +1,45 @@
|
||||
# Copyright (c) 2016-present Sonatype, Inc.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
FROM centos:centos7
|
||||
|
||||
MAINTAINER Sonatype <cloud-ops@sonatype.com>
|
||||
|
||||
ENV NEXUS_DATA /nexus-data
|
||||
LABEL vendor=Sonatype \
|
||||
com.sonatype.license="Apache License, Version 2.0" \
|
||||
com.sonatype.name="Nexus Repository Manager base image"
|
||||
|
||||
ENV NEXUS_VERSION 3.0.1-01
|
||||
|
||||
ENV JAVA_HOME /opt/java
|
||||
ENV JAVA_VERSION_MAJOR 8
|
||||
ENV JAVA_VERSION_MINOR 102
|
||||
ENV JAVA_VERSION_BUILD 14
|
||||
ARG NEXUS_VERSION=3.2.0-01
|
||||
ARG NEXUS_DOWNLOAD_URL=https://download.sonatype.com/nexus/3/nexus-${NEXUS_VERSION}-unix.tar.gz
|
||||
|
||||
RUN yum install -y \
|
||||
curl tar \
|
||||
&& yum clean all
|
||||
|
||||
# configure java runtime
|
||||
ENV JAVA_HOME=/opt/java \
|
||||
JAVA_VERSION_MAJOR=8 \
|
||||
JAVA_VERSION_MINOR=112 \
|
||||
JAVA_VERSION_BUILD=15
|
||||
|
||||
# configure nexus runtime
|
||||
ENV SONATYPE_DIR=/opt/sonatype
|
||||
ENV NEXUS_HOME=${SONATYPE_DIR}/nexus \
|
||||
NEXUS_DATA=/nexus-data \
|
||||
NEXUS_CONTEXT='' \
|
||||
SONATYPE_WORK=${SONATYPE_DIR}/sonatype-work
|
||||
|
||||
# install Oracle JRE
|
||||
RUN mkdir -p /opt \
|
||||
&& curl --fail --silent --location --retry 3 \
|
||||
@@ -24,33 +50,31 @@ RUN mkdir -p /opt \
|
||||
&& ln -s /opt/jdk1.${JAVA_VERSION_MAJOR}.0_${JAVA_VERSION_MINOR} ${JAVA_HOME}
|
||||
|
||||
# install nexus
|
||||
RUN mkdir -p /opt/sonatype/nexus \
|
||||
RUN mkdir -p ${NEXUS_HOME} \
|
||||
&& curl --fail --silent --location --retry 3 \
|
||||
https://download.sonatype.com/nexus/3/nexus-${NEXUS_VERSION}-unix.tar.gz \
|
||||
${NEXUS_DOWNLOAD_URL} \
|
||||
| gunzip \
|
||||
| tar x -C /opt/sonatype/nexus --strip-components=1 nexus-${NEXUS_VERSION} \
|
||||
&& chown -R root:root /opt/sonatype/nexus
|
||||
| tar x -C ${NEXUS_HOME} --strip-components=1 nexus-${NEXUS_VERSION} \
|
||||
&& chown -R root:root ${NEXUS_HOME}
|
||||
|
||||
## configure nexus runtime env
|
||||
# configure nexus
|
||||
RUN sed \
|
||||
-e "s|karaf.home=.|karaf.home=/opt/sonatype/nexus|g" \
|
||||
-e "s|karaf.base=.|karaf.base=/opt/sonatype/nexus|g" \
|
||||
-e "s|karaf.etc=etc|karaf.etc=/opt/sonatype/nexus/etc|g" \
|
||||
-e "s|java.util.logging.config.file=etc|java.util.logging.config.file=/opt/sonatype/nexus/etc|g" \
|
||||
-e "s|karaf.data=data|karaf.data=${NEXUS_DATA}|g" \
|
||||
-e "s|java.io.tmpdir=data/tmp|java.io.tmpdir=${NEXUS_DATA}/tmp|g" \
|
||||
-i /opt/sonatype/nexus/bin/nexus.vmoptions
|
||||
-e '/^nexus-context/ s:$:${NEXUS_CONTEXT}:' \
|
||||
-i ${NEXUS_HOME}/etc/nexus-default.properties
|
||||
|
||||
RUN useradd -r -u 200 -m -c "nexus role account" -d ${NEXUS_DATA} -s /bin/false nexus
|
||||
RUN useradd -r -u 200 -m -c "nexus role account" -d ${NEXUS_DATA} -s /bin/false nexus \
|
||||
&& mkdir -p ${NEXUS_DATA}/etc ${NEXUS_DATA}/log ${NEXUS_DATA}/tmp ${SONATYPE_WORK} \
|
||||
&& ln -s ${NEXUS_DATA} ${SONATYPE_WORK}/nexus3 \
|
||||
&& chown -R nexus:nexus ${NEXUS_DATA}
|
||||
|
||||
VOLUME ${NEXUS_DATA}
|
||||
|
||||
EXPOSE 8081
|
||||
USER nexus
|
||||
WORKDIR /opt/sonatype/nexus
|
||||
WORKDIR ${NEXUS_HOME}
|
||||
|
||||
ENV JAVA_MAX_MEM 1200m
|
||||
ENV JAVA_MIN_MEM 1200m
|
||||
ENV EXTRA_JAVA_OPTS ""
|
||||
ENV JAVA_MAX_MEM=1200m \
|
||||
JAVA_MIN_MEM=1200m \
|
||||
EXTRA_JAVA_OPTS=""
|
||||
|
||||
CMD bin/nexus run
|
||||
CMD ["bin/nexus", "run"]
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
Copyright (c) 2016-present Sonatype, Inc.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
|
||||
@@ -1,7 +1,12 @@
|
||||
# sonatype/nexus3
|
||||
# Sonatype Nexus3 Docker: sonatype/nexus3
|
||||
|
||||
A Dockerfile for Sonatype Nexus Repository Manager 3, based on CentOS.
|
||||
|
||||
* [Notes](#notes)
|
||||
* [Persistent Data](#persistent-data)
|
||||
* [Build Args](#build-args)
|
||||
* [Getting Help](#getting-help)
|
||||
|
||||
To run, binding the exposed port 8081 to the host.
|
||||
|
||||
```
|
||||
@@ -22,7 +27,6 @@ Copy the Dockerfile and do the build-
|
||||
$ docker build --rm=true --tag=sonatype/nexus3 .
|
||||
```
|
||||
|
||||
|
||||
## Notes
|
||||
|
||||
* Default credentials are: `admin` / `admin123`
|
||||
@@ -52,23 +56,32 @@ process, which runs as UID 200.
|
||||
These can be used supplied at runtime to control the JVM:
|
||||
|
||||
```
|
||||
$ docker run -d -p 8081:8081 --name nexus -e JAVA_MAX_HEAP=768m sonatype/nexus3
|
||||
$ docker run -d -p 8081:8081 --name nexus -e JAVA_MAX_MEM=768m sonatype/nexus3
|
||||
```
|
||||
|
||||
* 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](https://docs.docker.com/userguide/dockervolumes/)
|
||||
with Docker. See [Managing Data in Containers](https://docs.docker.com/engine/tutorials/dockervolumes/)
|
||||
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
|
||||
1. *Use a data volume*. Since data volumes are persistent
|
||||
until no containers use them, a volume can be created specifically for
|
||||
this purpose. This is the recommended approach.
|
||||
|
||||
```
|
||||
$ docker run -d --name nexus-data sonatype/nexus3 echo "data-only container for Nexus"
|
||||
$ docker run -d -p 8081:8081 --name nexus --volumes-from nexus-data sonatype/nexus3
|
||||
$ docker volume create --name nexus-data
|
||||
$ docker run -d -p 8081:8081 --name nexus -v nexus-data:/nexus-data sonatype/nexus3
|
||||
```
|
||||
|
||||
2. *Mount a host directory as the volume*. This is not portable, as it
|
||||
@@ -80,3 +93,21 @@ for additional information.
|
||||
$ 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
|
||||
```
|
||||
|
||||
### Build Args
|
||||
|
||||
The 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 --build-arg NEXUS_VERSION=3.x.y --build-arg NEXUS_DOWNLOAD_URL=http://.../nexus-3.x.y-unix.tar.gz .
|
||||
```
|
||||
|
||||
## Getting Help
|
||||
|
||||
Looking to contribute to our Docker image but need some help? There's a few ways to get information or our attention:
|
||||
|
||||
* File a public issue [here on GitHub](https://github.com/sonatype/docker-nexus3/issues)
|
||||
* Check out the [Nexus3](http://stackoverflow.com/questions/tagged/nexus3) tag on Stack Overflow
|
||||
* Check out the [Nexus Repository User List](https://groups.google.com/a/glists.sonatype.com/forum/?hl=en#!forum/nexus-users)
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
version: "2"
|
||||
|
||||
services:
|
||||
nexus:
|
||||
image: sonatype/docker-nexus3
|
||||
volumes:
|
||||
- "nexus-data:/nexus-data"
|
||||
ports:
|
||||
- "8081:8081"
|
||||
|
||||
volumes:
|
||||
nexus-data: {}
|
||||
Reference in New Issue
Block a user