Compare commits

...

25 Commits

Author SHA1 Message Date
Brad Beck cb564dbfd9 Updating to NXRM 3.5.2-01 2017-09-12 16:19:26 -05:00
Brad Beck e780ba3300 [NEXUS-13905] Put java user prefs in work directory (#77) 2017-09-12 08:26:28 -05:00
Brad Beck cff6c5c21c [NEXUS-14196] Expose MaxDirectMemorySize via INSTALL4J_ADD_VM_PARAMS (#76) 2017-08-31 16:38:30 -05:00
Brad Beck b06afeab86 update java 2017-08-31 15:43:17 -05:00
Brad Beck dbc580e6ab Updating to NXRM 3.5.1-02 2017-08-23 13:16:04 -05:00
Brad Beck ed60dbf8a9 Updating to NXRM 3.5.0-02 2017-08-03 12:05:49 -05:00
Brad Beck b4c2ff8142 update java 2017-07-19 09:09:31 -05:00
Jeffry Hesse 3250ddce03 Contribution Updates (#75)
* Change license to full Apache 2.0 text, as was the style at the time

* Add header to README

* Add in gitter badge

* Add in gitter blurb

* Standard Contribution stuff, small tweaks since it's Docker

* Add in contributors, and link to contribution guidelines from our README
2017-07-07 17:03:45 -05:00
Brad Beck 135a1c6493 Updating to NXRM 3.4.0-02 2017-07-05 16:39:01 -05:00
Brad Beck 1f5f927d71 Updating to NXRM 3.3.2-02 2017-06-19 15:30:14 -05:00
Nicholas Blair 97d3daf7fe update java download url (#74) 2017-05-23 09:52:17 -05:00
Brad Beck 222b63f15d Updating to NXRM 3.3.1-01 2017-05-01 15:26:44 -05:00
Brad Beck 7a91327b7f Updating to NXRM 3.3.0-01 2017-04-11 15:49:47 -05:00
Jeffry Hesse 65915646ed English!
Learn it!
2017-04-11 10:05:23 -08:00
Jeffry Hesse b7e9f09126 Update README.md
Change issue link to reflect that we use JIRA for our bug/etc... triage
2017-04-11 10:03:22 -08:00
Brad Beck 04c718287b [NEXUS-12835] Move java memory opts to INSTALL4J_ADD_VM_PARAMS (#72) 2017-04-10 13:08:16 -05:00
Joe Tom 2d1f4aaa59 Updating Dockerfile with 3.2.1
Latest release
2017-02-15 15:44:10 -05:00
Jeffry Hesse 6de8a22e19 Updating docker-compose to use the new appropriate image name (#65)
Ship it squirrel reporting for duty
2017-02-09 13:09:09 -09:00
Brad Beck 9ee35fedf9 Updating to NXRM 3.2.0-01 2016-12-16 12:17:28 -06:00
Brad Beck 1d3a2851a9 Introduce build arguments (#58)
Allow NEXUS_VERSION and NEXUS_DOWNLOAD_URL to be overridden at build time, e.g.

docker build -t nexus-custom --build-arg NEXUS_VERSION=3.2.0-SNAPSHOT --build-arg NEXUS_DOWNLOAD_URL=http://.../nexus-....-unix.tar.gz .
2016-12-12 14:18:16 -06:00
Joe Tom a9fe8de83e Merge pull request #54 from sonatype/joedragons-patch-1
Updating references to the non-deprecated image and header
2016-11-11 11:43:59 -05:00
Joe Tom 338e9dfcff Header change 2016-11-11 11:43:35 -05:00
Joe Tom 14a5413d9e Updating references to the non-deprecated image 2016-11-09 17:45:15 -05:00
Brad Beck cd24b0ade1 Updated JRE and reduced custom config (#51) 2016-11-04 10:15:42 -08:00
Yu-Lung Shao (Allen) e893e36611 update [Managing Data in Containers] url (#49) 2016-11-01 09:28:55 -08:00
8 changed files with 378 additions and 51 deletions
+40
View File
@@ -0,0 +1,40 @@
<!--
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.
-->
## How to be a contributor to this project
### Are you submitting a pull request?
* Use [our codestyle](https://github.com/sonatype/codestyle). If we get a PR that doesn't match it, there will be
much shaming throughout the land. If you use an editor besides Eclipse or IntelliJ, adapt the codestyle and submit a PR
there :)
* Fill out a CLA for us, so we can sort out all the legal parts of contributing. You can get all the information for
this [here](https://books.sonatype.com/nexus-book/reference/contrib.html). You may go, this is for your book, is it
applicable for this repo? Yes, absolutely. Follow the CLA process and email in your form. We are working on a way to
make this simpler, as well.
* Make sure to fill out an issue for your PR, so that we have traceability as to what you are trying to fix,
versus how you fixed it.
* Try to fix one thing per pull request! Many people work on this code, so the more focused your changes are, the less
of a headache other people will have when they merge their work in.
* Make sure to add yourself or your organization to CONTRIBUTORS.md as a part of your PR, if you are new to the project!
* If you're stuck, ask our [gitter channel](https://gitter.im/sonatype/nexus-developers)! There are a number of
experienced programmers who are happy to help with learning and troubleshooting.
### Are you new and looking to dive in?
* Check our issues to see if there is something you can dive in to.
* Come hang out with us at our [gitter channel](https://gitter.im/sonatype/nexus-developers).
+10
View File
@@ -0,0 +1,10 @@
Thanks for creating an issue! Please fill out this form so we can be
sure to have all the information we need, and to minimize back and forth.
* **What are you trying to do?**
* **What feature or behavior is this required for?**
* **How could we solve this issue? (Not knowing is okay!)**
* **Anything else?**
+12
View File
@@ -0,0 +1,12 @@
(brief, plain english overview of your changes here)
This pull request makes the following changes:
* (your change here)
* (another change here)
* (etc)
(If there are changes to user behavior in general, please make sure to
update the README, as well)
It relates to the following issue #s:
* Fixes #X
+37
View File
@@ -0,0 +1,37 @@
<!--
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.
-->
A lot of awesome people have contributed to this project! Here they are:
Sonatype internal people:
* [@bradbeck](https://github.com/bradbeck/) (Brad Beck)
* [@kellyrob99](https://github.com/kellyrob99/) (Kelly Robinson)
* [@joedragons](https://github.com/joedragons/) (Joe Tom)
* [@dbradicich](https://github.com/dbradicich/) (Damian Bradicich)
* [@nblair](https://github.com/nblair/) (Nicholas Blair)
* [@mrprescott](https://github.com/mrprescott/) (Michael Prescott)
* [@jeviolle](https://github.com/jeviolle/) (Rick Briganti/The Money)
* [@jswank](https://github.com/jswank/) (Jason Swank)
* [@DarthHater](https://github.com/darthhater/) (Jeffry Hesse)
External contributors:
* [@bestlong](https://github.com/bestlong/) (Yu-Lung Shao (Allen))
* [@jperville](https://github.com/jperville/) (Julien Pervillé)
![Possibly You!](http://i.imgur.com/A3eScYul.jpg)
+21 -21
View File
@@ -20,6 +20,9 @@ LABEL vendor=Sonatype \
com.sonatype.license="Apache License, Version 2.0" \
com.sonatype.name="Nexus Repository Manager base image"
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 \
curl tar \
&& yum clean all
@@ -27,20 +30,22 @@ RUN yum install -y \
# configure java runtime
ENV JAVA_HOME=/opt/java \
JAVA_VERSION_MAJOR=8 \
JAVA_VERSION_MINOR=102 \
JAVA_VERSION_BUILD=14
JAVA_VERSION_MINOR=144 \
JAVA_VERSION_BUILD=01 \
JAVA_DOWNLOAD_HASH=090f390dda5b47b9b721c7dfaa008135
# configure nexus runtime
ENV NEXUS_VERSION=3.1.0-04 \
NEXUS_HOME=/opt/sonatype/nexus \
ENV SONATYPE_DIR=/opt/sonatype
ENV NEXUS_HOME=${SONATYPE_DIR}/nexus \
NEXUS_DATA=/nexus-data \
NEXUS_CONTEXT=''
NEXUS_CONTEXT='' \
SONATYPE_WORK=${SONATYPE_DIR}/sonatype-work
# install Oracle JRE
RUN mkdir -p /opt \
&& curl --fail --silent --location --retry 3 \
--header "Cookie: oraclelicense=accept-securebackup-cookie; " \
http://download.oracle.com/otn-pub/java/jdk/${JAVA_VERSION_MAJOR}u${JAVA_VERSION_MINOR}-b${JAVA_VERSION_BUILD}/server-jre-${JAVA_VERSION_MAJOR}u${JAVA_VERSION_MINOR}-linux-x64.tar.gz \
http://download.oracle.com/otn-pub/java/jdk/${JAVA_VERSION_MAJOR}u${JAVA_VERSION_MINOR}-b${JAVA_VERSION_BUILD}/${JAVA_DOWNLOAD_HASH}/server-jre-${JAVA_VERSION_MAJOR}u${JAVA_VERSION_MINOR}-linux-x64.tar.gz \
| gunzip \
| tar -x -C /opt \
&& ln -s /opt/jdk1.${JAVA_VERSION_MAJOR}.0_${JAVA_VERSION_MINOR} ${JAVA_HOME}
@@ -48,27 +53,24 @@ RUN mkdir -p /opt \
# install 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 ${NEXUS_HOME} --strip-components=1 nexus-${NEXUS_VERSION} \
&& chown -R root:root ${NEXUS_HOME}
# configure nexus
RUN sed \
-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" \
-e '/^nexus-context/ s:$:${NEXUS_CONTEXT}:' \
-i ${NEXUS_HOME}/etc/nexus-default.properties \
&& mkdir -p ${NEXUS_DATA}/etc ${NEXUS_DATA}/log ${NEXUS_DATA}/tmp
&& 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 \
&& 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}
@@ -77,8 +79,6 @@ EXPOSE 8081
USER nexus
WORKDIR ${NEXUS_HOME}
ENV JAVA_MAX_MEM=1200m \
JAVA_MIN_MEM=1200m \
EXTRA_JAVA_OPTS=""
ENV INSTALL4J_ADD_VM_PARAMS="-Xms1200m -Xmx1200m -XX:MaxDirectMemorySize=2g -Djava.util.prefs.userRoot=${NEXUS_DATA}/javaprefs"
CMD ["bin/nexus", "run"]
+200 -11
View File
@@ -1,14 +1,203 @@
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
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
http://www.apache.org/licenses/LICENSE-2.0
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
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. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright [yyyy] [name of copyright owner]
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.
+57 -18
View File
@@ -1,15 +1,45 @@
# sonatype/docker-nexus3
<!--
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.
-->
# Sonatype Nexus3 Docker: sonatype/nexus3
[![Join the chat at https://gitter.im/sonatype/nexus-developers](https://badges.gitter.im/sonatype/nexus-developers.svg)](https://gitter.im/sonatype/nexus-developers?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
A Dockerfile for Sonatype Nexus Repository Manager 3, based on CentOS.
* [Contribution Guidlines](#contribution-guidelines)
* [Running and Building](#running-and-building)
* [Notes](#notes)
* [Persistent Data](#persistent-data)
* [Build Args](#build-args)
* [Getting Help](#getting-help)
## Contribution Guidelines
Go read [our contribution guidelines](/.github/CONTRIBUTING.md) to get a bit more familiar with how
we would like things to flow.
## Running And Building
To run, binding the exposed port 8081 to the host.
```
$ docker run -d -p 8081:8081 --name nexus sonatype/docker-nexus3
$ docker run -d -p 8081:8081 --name nexus sonatype/nexus3
```
To test:
@@ -23,7 +53,7 @@ To (re)build the image:
Copy the Dockerfile and do the build-
```
$ docker build --rm=true --tag=sonatype/docker-nexus3 .
$ docker build --rm=true --tag=sonatype/nexus3 .
```
## Notes
@@ -43,21 +73,19 @@ $ docker logs -f nexus
logs, and storage. This directory needs to be writable by the Nexus
process, which runs as UID 200.
* Three environment variables can be used to control the JVM arguments
* There is an environment variable that can used to pass JVM arguments to the startup script
* `JAVA_MAX_MEM`, passed as -Xmx. Defaults to `1200m`.
* `INSTALL4J_ADD_VM_PARAMS`, passed to the Install4J startup script. Defaults to `-Xms1200m -Xmx1200m -XX:MaxDirectMemorySize=2g -Djava.util.prefs.userRoot=${NEXUS_DATA}/javaprefs`.
* `JAVA_MIN_MEM`, passed as -Xms. Defaults to `1200m`.
* `EXTRA_JAVA_OPTS`. Additional options can be passed to the JVM via
this variable.
These can be used supplied at runtime to control the JVM:
This can be supplied at runtime:
```
$ docker run -d -p 8081:8081 --name nexus -e JAVA_MAX_MEM=768m sonatype/docker-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 /
@@ -65,22 +93,22 @@ process, which runs as UID 200.
This can be supplied at runtime:
```
$ docker run -d -p 8081:8081 --name nexus -e NEXUS_CONTEXT=nexus sonatype/docker-nexus3
$ 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*. Since data volumes are persistent
until no containers use them, a volume can be created specifically for
until no containers use them, 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/docker-nexus3
$ 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
@@ -90,13 +118,24 @@ 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/docker-nexus3
$ 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)
* Chat with us on [Gitter](https://gitter.im/sonatype/nexus-developers)
* File an issue [on our public JIRA](https://issues.sonatype.org/projects/NEXUS/)
* 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)
+1 -1
View File
@@ -2,7 +2,7 @@ version: "2"
services:
nexus:
image: sonatype/docker-nexus3
image: sonatype/nexus3
volumes:
- "nexus-data:/nexus-data"
ports: