Official Nexus image working with AMD & ARM processors
1.0K
Nexus docker image for AMD & ARM based processors.
Based on Alpine OpenJDK 8.
Official Website of Sonatype Nexus.
amd64, arm64Dockerfile links3.63.0, 3.63, 3, latest3.62.0, 3.623.61.0, 3.613.60.0, 3.603.59.0, 3.593.45.1, 3.453.44.0, 3.44nexus instance locallydocker volume create nexus-data
docker run --detach --name nexus -p 8081 -v nexus-data:/opt/sonatype/sonatype-work/nexus3/ pierrelouistalbot/nexus:latest
Once the container has started, wait a few minutes for the instance to initialize. Once it's done, run the following command to get the default admin password:
docker exec -it nexus cat /opt/sonatype/sonatype-work/nexus3/admin.password
There is no environment variable for now.
/opt/sonatype/sonatype-work/nexus3/ contains all the nexus data.The configuration is stored in the /opt/sonatype/sonatype-work/nexus3/etc/nexus.properties file.
See the "Official Images" FAQ for why there is no default HEALTHCHECK directive. However, you can set it up this way:
HEALTHCHECK --interval=30s --timeout=30s --start-period=5s --retries=3 \
CMD curl -f http://localhost:8081/service/metrics/healthcheck/ || exit 1
Run the following command to build and the image only for testing purposes
VERSION=3.63.0
SUFFIX=01
docker build --build-arg NEXUS_VERSION=${VERSION} --build-arg NEXUS_SUFFIX=${SUFFIX} --tag mynexus:latest .
docker run -p 8081 -it mynexus:latest
To build the image for production ready for processors architectures AMD and ARM, you first need to install builx.
buildx is a Docker CLI plugin for extended build capabilities with BuildKit.
Install the buildx plugin following the documentation
Setup a new builder instance and use it
docker buildx create --name mybuilder
docker buildx use mybuilder
docker buildx inspect --bootstrap
# Set the version
VERSION=3.63.0
SUFFIX=01
# For each platform build and push the image
docker buildx build --platform linux/amd64,linux/arm64 --build-arg NEXUS_VERSION=${VERSION} --build-arg NEXUS_SUFFIX=${SUFFIX} --tag nexus:$VERSION --load .
It is possible to run the image as root but it's not a good practice. The container will run as the entrypoint.sh script needs to run as root to change the owner of the /opt/sonatype/sonatype-work/nexus3 directory.
Pushing directly to registry using docker buildx build --push is not possible because I only get a 413 error. I have to export the image locally and then push it to the registry.
Nexus Repository OSS is distributed with Sencha Ext JS pursuant to a FLOSS Exception agreed upon between Sonatype, Inc. and Sencha Inc. Sencha Ext JS is licensed under GPL v3 and cannot be redistributed as part of a closed source work.
Content type
Image
Digest
sha256:cdb3d1768…
Size
533.1 MB
Last updated
about 2 months ago
docker pull pierrelouistalbot/nexus:fix-buildx-nodeselector-115