I have a docker image that spins up a container to perform a task in a short amount of time. When the task is finished, the container is exited.
The output of the docker ps -a command is shown below.
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
40be32cb4299 88841cd3d4a7 "/home/test/testing-…" 40 seconds ago Exited (0) 22 seconds ago beau_esi
I can't use docker exec -it -u root 40be32cb4299 bash since the container is automatically exited after a short time. Because the container has been exited, the output of the exec command returns the following error.
Error response from daemon: Container 40be32cb4299 is not running
Is there a way for me to run exec on this container so that I may alter some files inside it before doing a docker commit and saving as a new image?