Skip to content
Advertisement

Python creates Folder inside docker image but remove when processing completes

Python Program does create folder and put some files over there. But when i try to run the program inside docker via CMD It creates the folder and put files over there and upon completion, the folder somehow gets removed or doesnt show inside the docker image.

I have tried the following things:

  1. Check Folder Exist after creating – It shows folder created over there.
  2. Check inside the docker image using bash – It doesnt show the folder and contents.

The dockerfile is

JavaScript

Advertisement

Answer

Changes to filesystem are not stored in docker image. They exist in container created from an image but if you use ‘docker run’ command a new container is created.

User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement