Re:Running Docker in production for 6 months
by cpuguy83 on Friday November 11, 2016 @09:45AM
(#12931016)
Yes, you have to rebuild your image to deploy a new version.
But are you really changing code in production on the fly? This seems dangerous.
Also something that can technically be done with Docker, just it's really not a good idea (and that has nothing to do with Docker).
Re:Running Docker in production for 6 months
by orf on Friday November 11, 2016 @05:01PM
(#12934879)
Oh right, sorry, I thought it was obvious that you have to 'rebuild' the image when a code changes. But if you have a "COPY src/ /app" as the last command in your dockerfile then that's not an expensive operation as all the previous ones are cached.
Unless you change your system packages or add a new line to your requirements.txt, in which case the cache would be invalidated and the build takes longer.
But... it's done by your CI server anyway, so...
The article _specifically_ refers to production environments, and, by extension, staging servers:
“Good practices dictate that you don’t mount your source code directory in the docker container in production. Which means you also have to rebuild the image on test/staging server every time you make a single line of code change.”
Then it also states in the “logging” section that, contrary to the development environment “On production, since your source code directory isn’t mounted in container […];” so they clearly _are_ mounting the source code in the development containers.