pierrelouistalbot/nexus

By pierrelouistalbot

Updated about 2 months ago

Official Nexus image working with AMD & ARM processors

Image
Integration & delivery
Databases & storage
0

1.0K

pierrelouistalbot/nexus repository overview

Nexus

Nexus docker image for AMD & ARM based processors.
Based on Alpine OpenJDK 8.
Official Website of Sonatype Nexus.

Quick reference

How to use this image

Start a nexus instance locally
docker 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
Environment variables

There is no environment variable for now.

Volumes
  • /opt/sonatype/sonatype-work/nexus3/ contains all the nexus data.
Configuration

The configuration is stored in the /opt/sonatype/sonatype-work/nexus3/etc/nexus.properties file.

Image building

Health/Liveness/Readiness Checking

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
Build locally

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.

  1. Install the buildx plugin following the documentation

  2. Setup a new builder instance and use it

docker buildx create --name mybuilder
docker buildx use mybuilder
docker buildx inspect --bootstrap
  1. Build the image for all supported architectures
# 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 .

Notes

  • 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.

License Disclaimer

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.

Tag summary

Content type

Image

Digest

sha256:cdb3d1768

Size

533.1 MB

Last updated

about 2 months ago

docker pull pierrelouistalbot/nexus:fix-buildx-nodeselector-115