Paul Verest
Paul Verest

Reputation: 63912

Docker images proxy server (private docker registry) using Nexus OSS and reusing its dependency images

Nexus Repository Manager OSS can be used as caching proxy for jar artifacts, and as new feature for docker images.

I'd like to set up it for company usage within LAN. And want to use docker to install it (I could find docker image for nexus https://github.com/sonatype/docker-nexus3).

How can I point Nexus to use docker images on the server where it is installed, as Nexus OSS is actually Java application.

Note that we should be cautious about disk usages, possibly there's no way yet to clean-up registry.

Upvotes: 1

Views: 2875

Answers (1)

DarthHater
DarthHater

Reputation: 3292

To accomplish something like this, you'll likely want to setup https for Nexus Repository. This Docker image is a good starting point for that: https://hub.docker.com/r/bradbeck/nexus-https/

You'll also want to expose ports for any proxy, hosted or group repositories you plan on setting up. Follow instructions here: https://books.sonatype.com/nexus-book/3.2/reference/docker.html#docker-proxy for setting up a proxy.

Once you've setup the repositories you want, you will also need to expose these ports via Docker. You'll want to run a command similar to the following:

docker run -d -p 8081:8081 -p 8443:8443 -p 8444:8444 -v ~/nexus-data:/nexus-data -v ~/nexus-ssl:/opt/sonatype/nexus/etc/ssl --name nexus bradbeck/nexus-https

You may also need to modify the Dockerfile itself to expose the ports you want to use (I've used 8444 in this case). You'll do this modification here: https://github.com/bradbeck/nexus-https/blob/master/Dockerfile#L56

As well, a community member sent us a PR a while ago that setup a default Docker registry: https://github.com/sonatype/docker-nexus3/pull/48/files . We did not merge it as the changes are a bit broad (not everyone needs one setup by default), but perhaps it will help you on your quest :)

Upvotes: 3

Related Questions