4

I have a container which is based on tomcat image and I have mounted 'webapps' folder to hosted machine directory '/app/webapps'. Now for some updations I want to remove this webapps folder from inside the container but when I execute command: rm -rf webapps below error is produced:

rm: cannot remove 'webapps': Device or resource busy

So I want to know is it possible to remove mounted directory by executing a Linux command from inside the container or not?

Jaffy
  • 141
  • 2

1 Answers1

4

No, you sadly can't remove a volume that is in use by a container which is stated under 'Extended Description' here: https://docs.docker.com/engine/reference/commandline/volume_rm/

However, I'd suggest using docker for its strength and restarting the docker container after updating the directory externally.

Aliminator
  • 301
  • 1
  • 3