2

I run some docker images on an EC2 host and recently noticed, that the docker FS is always 100GB. The host FS is only 8GB though.

What would happen, if i use more than 8GB on the docker image? Magic?

cari
  • 2,114
  • 2
  • 14
  • 26
  • Well, to add that, I already found out how to check the available host disk space. You need to mount a folder on the host system with e.g. `VOLUME ["/var/cache/nginx"]` in your Dockerfile, then you get the free space of the host with `df -h`, when you're inside the container. – cari Dec 23 '15 at 14:49

1 Answers1

2

That comes from PR 14709 and the docker daemon --storage-opt dm.basesize= option:

Current default basesize is 10G. Change it to 100G. Reason being that for some people 10G is turning out to be too small and we don't have capabilities to grow it dyamically.

This is just overcommitting and no real space is allocated till container actually writes data. And this is no different then fs based graphdrivers where virtual size of a container root is unlimited.

So when you go over 8 GB, you should get a "No more space left on device" error message. No magic.

VonC
  • 1,042,979
  • 435
  • 3,649
  • 4,283
  • ok, ty for the clarification. thats what i thought. but can i see from within the docker container, how much space is left on the host drive? I guess its a common problem, how do ppl make sure they can really allocate the space they need? – cari Dec 23 '15 at 09:53
  • @cari the space allocated is minimal, but I am not sure how to check it from a container (that would be a good *new* and *separate* question of its own). That looks like http://stackoverflow.com/q/34430084/6309 and https://github.com/docker/docker/issues/18869. – VonC Dec 23 '15 at 09:56