dockerpromotions

One docker image for all environments


I want to use one docker image for all environments(build once deploy anywhere) and pass env vars when i run the container on test,qa,prod servers,i'm afraid if for eg devs are merging prs with new features to test branch then a new image is built and published to registry, does this in any way affect the image used for production and qa? Even if the containers were stopped and run again or image repulled? What can be done in this case?

One docker image for all environments, and run containers with environment variables


Solution

    1. All environments are on the same computer and use same example_image/example_image:latest

    Yes, prod and qa will be affected by the image update.

    1. All environments are on the different computers and use same example_image/example_image:latest

    Prod and qa will be affected by the image update only when you pull new image from the registry explicitly (if no configuration to pull image on each run automatically)

    1. Test uses example_image_test:latest/example_image:test, prod uses example_image_prod:latest/example_image:prod

    ( So they use the same image by nature but with different names. It is better practice than the options above )

    No, the prod won't be affected by the change of test image until you update prod image explicitly too.