| Great article, but I'm not sure it's a good idea to segment your Docker images by environment. Part of Docker's appeal is that you can be sure your staging & production containers are bit-for-bit the same. I use a workflow like this: * For all commits on all branches, run tests. If tests don't pass, don't push containers to registry. * For all commits on all branches, build and push a container `{branchname}-{commitsha}` (assuming tests pass). * Code review, etc. * Merge pull request to `master` branch (tests will run, and only push a container if they pass). * Deploy `master-{commitsha}` to staging. * Do your final testing on staging. * Deploy the same `master-{commitsha}` to production. Now you're deploying to production from the master branch, which passed tests, and the container is the same one as you tested on staging. Plus, you can always deploy your non-master `{branchname}-{commitsha}` images to a separate environment, or to staging, if you need to do a bit of experimenting. |