Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can docker "instance" run totally in ram?

Tags:

docker

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?

like image 234
stashfree Avatar asked Dec 01 '14 08:12

stashfree


People also ask

Does Docker run in RAM?

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.

How much RAM can a Docker container use?

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.

How much RAM is needed for Docker?

Available RAMMinimum: 8 GB; Recommended: 16 GB. AnzoGraph needs enough RAM to store data, intermediate query results, and run the server processes.

Can Docker run on 2GB RAM?

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.


2 Answers

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.

like image 64
Vincent Woo Avatar answered Oct 09 '22 12:10

Vincent Woo


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/

like image 34
Adrian Mouat Avatar answered Oct 09 '22 11:10

Adrian Mouat