I want to use Docker's storage_opt CLI flag to create containers that have a maximum storage allowance. I'm using Windows, and all the guides and examples from Docker to third-party advice all centres around Linux. How do I apply this storage want to WSL Windows Docker?
How do I emulate the following command on Windows:
Command:
docker run ubuntu:latest --mem_limit 100m --name xyz --storage_opt size=100m
Error:
("--storage-opt is supported only for overlay over xfs with 'pquota' mount option")
List of things I've read/tried:
- Setting the
"storage-driver"key in the Docker Engine area of the Docker Desktop settings. This caused my install to crash and stopped working, needing a full reinstall. - https://reece.tech/posts/docker-container-size-quota/
- docker and image size limit
- https://docs.docker.com/storage/storagedriver/overlayfs-driver/
- Docker Per-Container Disk Quota on Bind Mounted Volumes (grub isn't on Windows, this is a Linux bootloader no?)
- https://fabianlee.org/2020/01/15/docker-use-overlay2-with-an-xfs-backing-filesystem-to-limit-rootfs-size/
- https://www.reddit.com/r/docker/comments/loleal/how_to_limit_disk_space_for_a_docker_container/
- https://forums.docker.com/t/limit-disk-space-in-a-docker-container/61068/2
I understand I have to somehow change Docker's filesystem to overlay with xfs with some storage flag or environmental variable, but I don't understand where in the stack that is (on my system, or in the image) or if I'm thinking about it completely wrong.
All I'm after is a way to set a ceiling on the amount of storage (say 100MB) on a Docker container I build, and presumably be able to edit it. I believe this is best done through Docker, but I could be wrong - thanks for any help.