I would like to power a docker instance in ram... totally inside ram... using tmpfs
Can it be done?
I'm not sure how docker uses filesystems as I'm too used to using kvm and xen, they both need to set up a default size before it can be used.
So how does "docker fs" work?
By default, Docker containers have access to the full RAM and CPU resources of the host. Leaving them to run with these default settings may lead to performance bottlenecks. If you don't limit Docker's memory and CPU usage, Docker can use all the systems resources.
The maximum amount of memory the container can use. If you set this option, the minimum allowed value is 6m (6 megabytes). That is, you must set the value to at least 6 megabytes.
Available RAMMinimum: 8 GB; Recommended: 16 GB. AnzoGraph needs enough RAM to store data, intermediate query results, and run the server processes.
Most notably, if you don't need GUI (aka graphical user session), the requirements on RAM drop dramatically. So yes, Ubuntu can very easily run on 2GB RAM, even much less. Why does Docker Desktop on macOS take up 2GB of RAM with no containers running? Because you have 2GB of Memory allocated in Resources.
This can be done. If you mount /var/lib/docker on a tmpfs, Docker can use other storage backends, like OverlayFS, on top of it.
Docker uses what it calls a "Union File System", made up of multiple read-only layers with a copy-on-write layer on top (see http://docs.docker.com/terms/layer/). It can use one of several storage drivers for this (in order of preference): AUFS, BTRFS, devicemapper, overlayfs or VFS. Because of this, no, I don't think you will be able to use tmpfs.
More information at https://developerblog.redhat.com/2014/09/30/overview-storage-scalability-docker/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With