Disclaimer
You have probably heard countless times that you
should never edit a docker container's state, or
editing container state is an anti-pattern, or
if you need to edit a container's state you should use volumes. That advice is good advice and so this article starts with a disclaimer.
If you really need to edit file(s) within a docker container you most likely should do it in one of two ways:
- Use a docker volume; or
- Make any edits to the file(s) part of the image's DOCKERFILE
I would recommend
never editing a file in production unless the...
Continue Reading
Introduction
There are a number of reasons for wanting to open a shell within a running container, including:
- To see the contents of any number of configuration files.
- To make a quick change to a file which is not part of any of the container's mounted volumes.
- It should be noted that this is most likely an anti-pattern. However, it could also be argued that it is harmless if the change is minor and is made only in development environments for debugging and tweaking.
- If the change you are making is intended to be permanent you should consider capturing it...Continue Reading