dotcloud/docker — pull request #1056 by justinsb (2013-06-28 16:49:07+00:00)
Title: Support file injection

Support file injection into the containers e.g. SSH authorized keys. An alternative is to support cloud-init, but this seems more lightweight (and cloud-init support would probably require file injection of the config files anyway!)

Injected files are first injected into a new volume-like mount that is auto-created, at /.docker. Files to be injected are created under /.docker/files, e.g. /.docker/files/root/.ssh/authorized_keys.

Files are then recursively copied by .dockerinit from /.docker/files to /

File modes can be specified. All files/directories are currently owned by root, and any missing directories are mode 700. This "works for me", in that I typically want to inject system files, in particular the root ssh key. Fixing ownership would be tricky because of different UIDs (?)

The /.docker mountpoint may be generally applicable; e.g. it may be cleaner than the specialized /etc/resolv.conf mountpoint (which then means /etc/resolv.conf is readonly in the guest).