Docker 101 : Using the host's RAM as a temporary storage for the containers



The host's RAM could offer a high speed temporary storage for container's data through the "tmpfs" filesystem.


A tmpfs storage can't be shared among multiple containers.
We can start a container and associate a "RAM" storage to it using the below command:


- target: mountpoint in the container.

Other mount options:

We could also use other option with the above command:

- tmpfs-mode: we use it to set read, write and execute permissions on the storage
- tmpfs-size: specifies the size of the storage, for example "30m" for "thirty megabytes".

Displaying the "tmpfs" volumes:

We can display our volumes mount using the below command:


We could also display the volume mounts from within the running container, using the below command:


Or from our host, if the container is in a "running" state:


Comments

Leave as a comment:

Archive