Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| cb564dbfd9 | |||
| e780ba3300 | |||
| cff6c5c21c | |||
| b06afeab86 | |||
| dbc580e6ab |
+6
-5
@@ -20,7 +20,7 @@ LABEL vendor=Sonatype \
|
||||
com.sonatype.license="Apache License, Version 2.0" \
|
||||
com.sonatype.name="Nexus Repository Manager base image"
|
||||
|
||||
ARG NEXUS_VERSION=3.5.0-02
|
||||
ARG NEXUS_VERSION=3.5.2-01
|
||||
ARG NEXUS_DOWNLOAD_URL=https://download.sonatype.com/nexus/3/nexus-${NEXUS_VERSION}-unix.tar.gz
|
||||
|
||||
RUN yum install -y \
|
||||
@@ -30,9 +30,9 @@ RUN yum install -y \
|
||||
# configure java runtime
|
||||
ENV JAVA_HOME=/opt/java \
|
||||
JAVA_VERSION_MAJOR=8 \
|
||||
JAVA_VERSION_MINOR=141 \
|
||||
JAVA_VERSION_BUILD=15 \
|
||||
JAVA_DOWNLOAD_HASH=336fa29ff2bb4ef291e347e091f7f4a7
|
||||
JAVA_VERSION_MINOR=144 \
|
||||
JAVA_VERSION_BUILD=01 \
|
||||
JAVA_DOWNLOAD_HASH=090f390dda5b47b9b721c7dfaa008135
|
||||
|
||||
# configure nexus runtime
|
||||
ENV SONATYPE_DIR=/opt/sonatype
|
||||
@@ -65,6 +65,7 @@ RUN sed \
|
||||
&& sed \
|
||||
-e '/^-Xms/d' \
|
||||
-e '/^-Xmx/d' \
|
||||
-e '/^-XX:MaxDirectMemorySize/d' \
|
||||
-i ${NEXUS_HOME}/bin/nexus.vmoptions
|
||||
|
||||
RUN useradd -r -u 200 -m -c "nexus role account" -d ${NEXUS_DATA} -s /bin/false nexus \
|
||||
@@ -78,6 +79,6 @@ EXPOSE 8081
|
||||
USER nexus
|
||||
WORKDIR ${NEXUS_HOME}
|
||||
|
||||
ENV INSTALL4J_ADD_VM_PARAMS="-Xms1200m -Xmx1200m"
|
||||
ENV INSTALL4J_ADD_VM_PARAMS="-Xms1200m -Xmx1200m -XX:MaxDirectMemorySize=2g -Djava.util.prefs.userRoot=${NEXUS_DATA}/javaprefs"
|
||||
|
||||
CMD ["bin/nexus", "run"]
|
||||
|
||||
@@ -75,14 +75,17 @@ process, which runs as UID 200.
|
||||
|
||||
* There is an environment variable that can used to pass JVM arguments to the startup script
|
||||
|
||||
* `INSTALL4J_ADD_VM_PARAMS`, passed to the Install4J startup script. Defaults to `-Xms1200m -Xmx1200m`.
|
||||
* `INSTALL4J_ADD_VM_PARAMS`, passed to the Install4J startup script. Defaults to `-Xms1200m -Xmx1200m -XX:MaxDirectMemorySize=2g -Djava.util.prefs.userRoot=${NEXUS_DATA}/javaprefs`.
|
||||
|
||||
This can be supplied at runtime:
|
||||
|
||||
```
|
||||
$ docker run -d -p 8081:8081 --name nexus -e INSTALL4J_ADD_VM_PARAMS="-Xms2g -Xmx2g" sonatype/nexus3
|
||||
$ docker run -d -p 8081:8081 --name nexus -e INSTALL4J_ADD_VM_PARAMS="-Xms2g -Xmx2g -XX:MaxDirectMemorySize=3g -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 Nexus Repository License if the container is restarted.
|
||||
|
||||
* Another environment variable can be used to control the Nexus Context Path
|
||||
|
||||
* `NEXUS_CONTEXT`, defaults to /
|
||||
|
||||
Reference in New Issue
Block a user