1

We have a set of legacy Gradle projects that I am working on migrating to building in Docker.

Unfortunately they download quite a bit of Maven artifacts from our internal Artifactory server for every build, which is rather slow when working remotely over VPN. Until we get that fixed properly, I would like to have a local dockerized Nexus3 mirroring Artifactory so I can cache them locally.

I have Nexus3 OSS running in my local Docker Desktop. I have set up manually two mirror against Artifactory with proper credentials, and one grouping them together, but I have to do this every time the container is recreated. As of now, this is all that is needed for our usage.

I would like to be able to preconfigure this in the Docker image somehow, instead, so our local configuration comes up and running without manual intervention. I'm fine with baking in my credentials locally. The REST API looks promising but will probably require manually running a script after Nexus is ready, which makes it a plan B.

Can this be done in Nexus3 OSS, and if so how?

  • _(Disclaimer: I'm the author of most linked answers and script)_. Please see [this answer](https://stackoverflow.com/a/74775636/9401096) which gives a solution to customize your docker image on start. You can then see [this script](https://github.com/ansible-ThoTeam/nexus3-oss/blob/main/files/groovy/create_repos_from_list.groovy) which you could use in the same maner to create any repos from a list. – Zeitounator Jan 08 '23 at 17:29

0 Answers0