dotcloud/docker — pull request #1401 by leakybkt (2013-08-04 03:48:10+00:00)
Title: Add option for tmpfs based read-write container root

This adds a '-tmpfsroot' option that causes the rw directory to be created as a tmpfs (ie, ram backed) directory. I want to use this setup in order to have very fast writes for my containers. The rw directory is mounted & unmounted on container start and stop, so anyone using this needs to be prepared for their files to reset on start and stop.

An example call:
docker run -i -t -d -tmpfsroot="size=1g" ubuntu /bin/bash

I should note that the aufs man warns against tmpfs usage like this: tmpfs doesn't track in-use inode numbers, and uses a simple counter for allocation. My interpretation of the man page is that you would need to in-memory inodes with the same number, so you would need to create an tmpfs file/directory and keep it around until the (32-bit) counter wraps.