I want to create Docker images for different environments (Dev, Test and Prod). I did create three different Dockerfiles.
I found following two options to manage different version of images in single repository or multiple repositories.
Option 1: Build images with different tags and push it to the single docker repository?
Option 2: Create separate docker repository for each environment and push corresponding images?
I would like to know what would be the preferred option or any other ideas?
It is generally preferred to have a separate registry for production and a separate one for dev/test.
The reason to do so is that developers can push to dev/test registry and the QA team can pull non-production images from there for continuous development and testing.
This also helps in keeping the production registry secure and also protected from unwanted overrides due to name clashes when developer pushes them to a shared registry.