Registry Middleware to validate docker push

Related to: https://docs.docker.com/registry/configuration/

I am running a private registry using the image registry:latest at localhost:5000

Let’s say I want to push some image into the registry docker push localhost:5000/name.

I want the registry before executing the push do some validations such as

  • Reject when the catalog already has a repository with that name
  • Automatically add version tags to the pushed image
  • Create a container, make an API call to the container, reject the push based on the results… (perhaps delete the image)

Any docs that explain how to do it?

@suryak were you able to figure this out?