I have a web application in a Docker container. I need to limit maximum size of some of its directories. When I was not using Docker, I just created disk partitions of the limit size and put those directories to there. But since Docker seems to share disk partitions with the external system (the output of lsblk command inside the container is exactly the same as if performed outside), this approach is not possible.

How to solve this? Is there possibly a tool which check the size of a directory and denies the permission to write if the size extends the limit?

  • What about a limited partition like you already did, create desired folders there and mount them with e.g. --volume /limitedpartition/var:/var:rw? – mviereck Mar 9 '18 at 17:56
  • that is for sure a possibility, but it violates the principle of keeping the deployment as simple as possible - something else needs to be done besides just running the docker image and I would like to avoid this – karlosss Mar 9 '18 at 23:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.