Docker commit Saving as new image by editing docker container

0 votes

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?

Apr 30, 2022 in Docker by rajiv
• 1,620 points

edited 4 days ago 9 views

No answer to this question. Be the first to respond.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP