What’s the best way to add changes to an image (Wordpress for example) and use git to keep a history.
So for example, I have a Wordpress image and a MySQL one. I also use a named volume to persist the MySQL data. How would I customize the Wordpress site on my dev box in a way that I could commit changes to git and also have instant feedback (without having to re-build the image every time I make a change).
Write a Dockerfile to start from the base image and make whatever changes you need. Whenever you need to change the contents of the image (or update the base image), run docker build to rebuild it from scratch. Keep the Dockerfile and any extra files you need to add in source control.
(docker build is pretty quick, especially if you avoid doing complicated build steps from within the Dockerfile and if you can use layer caching to avoid doing things like package installations over and over.)
That sounds ok but I need instant feedback while developing. Take for example changing some css, you change a value and reload your browser. I don’t want to pay the penalty of having to build the image for such a small change.