Docker Community Forums

Share and learn in the Docker community.

Not able to delete directories in new container created from existing container

docker

(Sanjaykumbhale) #1

Hello,

I have created an image say Img1 from dockerfile. Then created a container say Cnt1 from that image.
Then made some changes in container Cn1.
After some days I committed Cn1 to new image say Img2.
Now created new container say Cn2 from new image img2.
Now getting an error while trying to delete some existing directories in new container i.e Cn2.
Using rm -rf command getting error message

rm: cannot remove ‘ssl-cert-mgmt/META-INF/maven/com.grit.ssl’: Directory not empty

And using rm -r command getting error message

rm: cannot remove ‘ssl-cert-mgmt/META-INF/maven/com.grit.ssl/ssl-cert-mgmt’: Invalid argument

Anybody got such kind of issues. Please let me know.


(Sam) #2

is the command rm -rf running as root or some other user?


(Sanjaykumbhale) #3

Since we running command inside docker by default is as root user only.
We are not using any sudo user.


(Sam) #4

i am gonna ‘guess’ here that commit makes the prior content not removable.
I don’t KNOW this for a fact, just guessing

if u make another folder and copy the content there, I am sure u can delete the new content…

the other thing would be some process in that folder or using some file in that folder


(Sanjaykumbhale) #5

Yes correct, If i make another folder I am able to delete it but deletion of existing folder is not happening. Its deleting all files of existing folder but not deleting the folder.
I did not found any way to find the folder is used by any process.