This docker image is more or less a clone of sonatype's sonatype/nexus3 image from the officiall docker hub repository. It differs in:
In this way the created image is very small compared to original. You can set USER_UID + USER_GID, which allows you to persist data in a host directoy without hadache.
cd $HOME
mkdir nexus-data
docker run -d \
-e USER_GID=$(id -g) \
-e USER_UID=$(id -u) \
-p 18081:8081 \
-v $PWD/nexus-data:/nexus-data \
--name nexus3 didlich/nexus3
docker build --rm=true --tag=didlich/nexus3 .
The following optional variables can be used when building the image:
curl -u admin:admin123 http://localhost:18081/service/metrics/ping
docker logs -f nexus3
This can be adjusted at runtime:
docker run -d \
-p 8081:8081 \
-e INSTALL4J_ADD_VM_PARAMS="-Xms2g -Xmx2g -XX:MaxDirectMemorySize=3g -Djava.util.prefs.userRoot=/some-other-dir" \
--name nexus didlich/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.
This can be supplied at runtime:
docker run -d \
-p 8081:8081 \
-e NEXUS_CONTEXT=nexus \
--name nexus didlich/nexus3
There are two general approaches to handling persistent storage requirements with Docker. See Managing Data in Containers for additional information.
docker volume create --name nexus-data
docker run -d \
-p 8081:8081 \
-v nexus-data:/nexus-data \
--name nexus didlich/nexus3
docker run -d \
-p 8081:8081 \
-e USER_GID=$(id -g) \
-e USER_UID=$(id -u) \
-v /some/dir/nexus-data:/nexus-data \
--name nexus didlich/nexus3
Content type
Image
Digest
Size
195.5 MB
Last updated
about 5 years ago
docker pull didlich/nexus3