For all the experienced DevOps guys, I have a question about deploying a private registry as part of a stack in a swarm.
It seems from docker documentation that registry needs to be first defined and exposed (and also secured) and images pushed into it first. And only then it can be used in a stack.
But I’m wondering if I only want to use this registry container for the specific stack I am deploying, is there a way to define the registry as part of the docker-compose.yml and then define other containers with depends_on -myregistry?
My general container structure is: app, Jenkins, secure Nginx as reverse proxy (this is the only one exposed to the host), and now I want to add the registry container (because I gather this is the only way to run the swarm..or is it?)
What I am trying to achieve here is to have a stack that can be deployed right away with docker stack deploy —compose-file , without having to first create the registry and pushing images into it. Also, in theory if this registry is only accessible to the services that are part of the stack, then it doesn’t really need all that security..is it true?
Any guidance will be greatly appreciated.