Compare commits

...

26 Commits

Author SHA1 Message Date
Damian Bradicich abac465289 NEXUS-11119 - Nexus 3.1 and required layout changes (#50) 2016-11-01 07:53:47 -04:00
DartHater 3c7173fb66 Removing link to HC channel 2016-10-31 12:34:26 -08:00
Jeffry Hesse 222feb87e9 Update README to add Getting Help section (#45)
* Addition of section in README on how to get help, addition of TOC to be more in line with the rhel image README
2016-10-21 13:44:38 -08:00
DartHater acfe030b2c Update to docs fixes #42 2016-10-17 09:16:28 -08:00
Jeffry Hesse be84bce298 Modifications to ENV variables to follow best practices (#41) 2016-10-14 10:28:08 -08:00
Kelly Robinson f9971ab0c0 Fabdouglas patch 1 (#40)
* Add an ENV to configure initial context

Add an ENV to configure initial context and avoid a manual step either with a "docker exec" either with a temporary UI access with root (/) context to change it.
Default value of NEXUS_CONTEXT is "/".

* Update Dockerfile

* https://github.com/sonatype/docker-nexus3/pull/19
- use ENV variable in replacement

* https://github.com/sonatype/docker-nexus3/pull/19
- remove unrelated change https://github.com/sonatype/docker-nexus3/pull/19/files#r72501650

* https://github.com/sonatype/docker-nexus3/pull/19
- fix doubling of contexts path in regex
- properly escape variable definition for NEXUS_CONTEXT

* Add an ENV to configure initial context

Add an ENV to configure initial context and avoid a manual step either with a "docker exec" either with a temporary UI access with root (/) context to change it.
Default value of NEXUS_CONTEXT is "/".

* Update Dockerfile

* https://github.com/sonatype/docker-nexus3/pull/19
- use ENV variable in replacement

* https://github.com/sonatype/docker-nexus3/pull/19
- remove unrelated change https://github.com/sonatype/docker-nexus3/pull/19/files#r72501650

* https://github.com/sonatype/docker-nexus3/pull/19
- fix doubling of contexts path in regex
- properly escape variable definition for NEXUS_CONTEXT

* Adding example for setting NEXUS_CONTEXT to README.md

* https://github.com/sonatype/docker-nexus3/pull/19
- fix incorrect slash
2016-10-13 14:43:36 -07:00
Jeffry Hesse 469ac29f7d Update image name to docker-nexus3 (#39)
* Updating image name to reflect new automated build on Dockerhub

* Update docker image name for docker compose
2016-10-12 12:29:45 -08:00
Jeffry Hesse 381241b6ae Update License shorthand (#34) 2016-10-04 10:00:40 -08:00
Jason Swank 3be88b6f4f Merge pull request #33 from DarthHater/master
Specify Docker-nexus3 license as APLv2
2016-10-04 13:29:51 -04:00
DartHater f4b78f48b1 Merge remote-tracking branch 'upstream/master' 2016-10-04 09:13:22 -08:00
DartHater b8cddf1c63 Typo 2016-10-04 09:11:46 -08:00
Julien Pervillé 4beac47b22 Dockerfile: CMD use the recommended 'exec' form instead of 'shell' form. (#22) 2016-10-03 12:33:01 -08:00
DartHater 88aaa11b5d Change year to appropriate year 2016-09-30 16:25:38 -08:00
DartHater 06998bb28f Add license header 2016-09-30 16:23:58 -08:00
DartHater cd97ed93ac Switching labels to reverse DNS notation 2016-09-30 15:11:22 -08:00
DartHater 17da9bc447 Setting license to APLv2 2016-09-30 14:47:18 -08:00
Jeffry Hesse b4835eee02 Update Persistent Data to use docker volume instead of data container (#32)
* Update to creating Docker volume now that you can use docker volume to create a data container

* Update of text around commands
2016-09-30 10:42:27 -08:00
DartHater 68f8d092db Update of text around commands 2016-09-30 10:18:45 -08:00
DartHater b8061cd565 Merge branch 'master' of https://github.com/DarthHater/docker-nexus3 2016-09-30 09:56:05 -08:00
DartHater 3139f9340a Update to creating Docker volume now that you can use docker volume to create a data container 2016-09-30 09:55:26 -08:00
DartHater 255a50947d Update to creating Docker volume now that you can use docker volume to create a data container 2016-09-30 09:51:21 -08:00
Jeffry Hesse 861ceb376d Docker compose file for Nexus Repository Manager 3 (#31) 2016-09-30 08:06:42 -08:00
DartHater 3566cd9ab0 Docker compose file for Nexus Repository Manager 3 2016-09-29 13:50:47 -08:00
Kelly Robinson eef5f067e2 revert erroneous commit(wrong branch) 2016-09-12 12:59:23 -07:00
Kelly Robinson e651dd9cf8 add .gitnore 2016-09-12 12:57:45 -07:00
Kelly Robinson 33fbccb149 Update README.md 2016-09-12 12:56:35 -07:00
5 changed files with 134 additions and 36 deletions
+25
View File
@@ -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
+53 -25
View File
@@ -1,19 +1,41 @@
# 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
ENV NEXUS_VERSION 3.0.2-02
ENV JAVA_HOME /opt/java
ENV JAVA_VERSION_MAJOR 8
ENV JAVA_VERSION_MINOR 102
ENV JAVA_VERSION_BUILD 14
LABEL vendor=Sonatype \
com.sonatype.license="Apache License, Version 2.0" \
com.sonatype.name="Nexus Repository Manager base image"
RUN yum install -y \
curl tar \
&& yum clean all
# configure java runtime
ENV JAVA_HOME=/opt/java \
JAVA_VERSION_MAJOR=8 \
JAVA_VERSION_MINOR=102 \
JAVA_VERSION_BUILD=14
# configure nexus runtime
ENV NEXUS_VERSION=3.1.0-04 \
NEXUS_HOME=/opt/sonatype/nexus \
NEXUS_DATA=/nexus-data \
NEXUS_CONTEXT=''
# install Oracle JRE
RUN mkdir -p /opt \
&& curl --fail --silent --location --retry 3 \
@@ -24,33 +46,39 @@ 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 \
| 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 "s|karaf.home=.|karaf.home=${NEXUS_HOME}|g" \
-e "s|karaf.base=.|karaf.base=${NEXUS_HOME}|g" \
-e "s|karaf.etc=etc|karaf.etc=${NEXUS_HOME}/etc|g" \
-e "s|java.util.logging.config.file=etc|java.util.logging.config.file=${NEXUS_HOME}/etc|g" \
-e "s|karaf.data=.*|karaf.data=${NEXUS_DATA}|g" \
-e "s|java.io.tmpdir=.*|java.io.tmpdir=${NEXUS_DATA}/tmp|g" \
-e "s|LogFile=.*|LogFile=${NEXUS_DATA}/log/jvm.log|g" \
-i ${NEXUS_HOME}/bin/nexus.vmoptions \
&& sed \
-e "s|nexus-context-path=/|nexus-context-path=/\${NEXUS_CONTEXT}|g" \
-i ${NEXUS_HOME}/etc/nexus-default.properties \
&& mkdir -p ${NEXUS_DATA}/etc ${NEXUS_DATA}/log ${NEXUS_DATA}/tmp
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 \
&& 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"]
+14
View File
@@ -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.
+30 -11
View File
@@ -1,12 +1,15 @@
# sonatype/nexus3
# sonatype/docker-nexus3
A Dockerfile for Sonatype Nexus Repository Manager 3, based on CentOS.
* [Notes](#notes)
* [Persistent Data](#persistent-data)
* [Getting Help](#getting-help)
To run, binding the exposed port 8081 to the host.
```
$ docker run -d -p 8081:8081 --name nexus sonatype/nexus3
$ docker run -d -p 8081:8081 --name nexus sonatype/docker-nexus3
```
To test:
@@ -20,10 +23,9 @@ To (re)build the image:
Copy the Dockerfile and do the build-
```
$ docker build --rm=true --tag=sonatype/nexus3 .
$ docker build --rm=true --tag=sonatype/docker-nexus3 .
```
## Notes
* Default credentials are: `admin` / `admin123`
@@ -53,9 +55,18 @@ 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/docker-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/docker-nexus3
```
### Persistent Data
@@ -63,13 +74,13 @@ There are two general approaches to handling persistent storage requirements
with Docker. See [Managing Data in Containers](https://docs.docker.com/userguide/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/docker-nexus3
```
2. *Mount a host directory as the volume*. This is not portable, as it
@@ -79,5 +90,13 @@ 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
$ docker run -d -p 8081:8081 --name nexus -v /some/dir/nexus-data:/nexus-data sonatype/docker-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:
* 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)
+12
View File
@@ -0,0 +1,12 @@
version: "2"
services:
nexus:
image: sonatype/docker-nexus3
volumes:
- "nexus-data:/nexus-data"
ports:
- "8081:8081"
volumes:
nexus-data: {}