Image / Docker / OS FileSystem Info

Hi All

I’m new to docker, and have a few questions (I couldn’t see a newbie area, so hopefully this General Discussion will be ok to post a question.

I’m trying to get my head around the Docker concepts, I’ve understood the basics, but I can’t work out how do you size the file systems or how does it work between the contained image layer > Docker Engine > OS FileSystem.
Example : Traditionally I would create a filesystem and ensure there is space for the db example /databases = 40GB. (This is along with the usual file system mounts /opt, /var etc.

Now if I build my OS Cento OS (physical/virtual), I then install the docker engine, download the image say postgres, at this point how can I ensure the mount /databases is going to be 40 GB or how does it work, or how does one ensure the database mount size will be one that is required?

If any one can shed some light, that would be great


Depending on your exact Docker setup, it shares the filesystem with the host, usually /var.

There’s one common configuration where all of the Docker state is stored inside a fixed-size file. If you run docker info and it says (IIRC) “devicemapper” and “loopback” then you’re in this setup, but the same command will also tell you how much space is there. This tends to not be a recommended setup, except that it is very easy to set up the first time.

You can also use the docker volume command to cause a volume to mount some external filesystem, or the docker run -v command to make a specific host directory be that /databases directory inside the container. (This has some subtleties if the image starts with data in that directory; the host directory content will simply appear in the bind-mounted directory and hide what was in the image, just like you had mounted a new filesystem over the directory.)

Hi Mate

Many thanks, penny dropped with the shared file system and the other info is great.