puckeyp
(Puckeyp)
August 31, 2022, 8:27pm
1
Maybe a stupid question, but I cannot figure out how to delete a directory in a container from the docker host.
I tried the instruction
sudo docker rm -R <container_ID>:/Backup
to remove the directory “Backup”, but that does not work: -R not recognised.
Any help is appreciated
PPee
meyay
(Metin Y.)
August 31, 2022, 8:36pm
2
Use docker exec | Docker Documentation while the container is running.
puckeyp
(Puckeyp)
August 31, 2022, 8:52pm
3
Hi meyay,
Thx for quick response. I looked at the docker exec options, but cannot find the right instruction for removing a directory. How to use the exec options for this?
terpz
(Martin Terp)
September 1, 2022, 6:08am
4
docker exec, is a command for running a command in a container.
So in your case it would be:
docker exec -ti CONTAINER-ID rm -r /backup