Is it possible to create a Docker registry via API/REST call?


I want to create a Docker image which creates a Nexus repository and adds a Docker registry. I tried adding it manually to check what it saves in the /v1/repositories call. But there is no information about the Docker port.

So my question is: is there a way to add a Docker registry to Nexus programmatically?

Hi Christian,

We’ve so far split the 2.

We created the Nexus Repo using a Docker Image.

Then, once it’s up-and-running, created repo’s by firstly uploading some Groovey scripts to create blobstores and repositories using the Upload Script API call, then secondly uploading the necessary information via a json file for the script to run.

We created a Hosted Docker Repo/Registry.

Still quite a few wee manual steps, but ultimately I imagine with some creative scripting you may be able to do it all in one.

This person’s GitHub a decent place to start:

Hope this helps or that I’ve understood your question properly

1 Like