From 88ef5f36304d6d6add239e4e0dc60f41bcbf0fcc Mon Sep 17 00:00:00 2001 From: Jan Losinski Date: Thu, 11 Feb 2016 19:20:30 +0100 Subject: [PATCH] Add documentation for the Tmpfs Hostconfig option. Signed-off-by: Jan Losinski --- docs/hostconfig.md | 2 ++ docs/tmpfs.md | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 34 insertions(+) create mode 100644 docs/tmpfs.md diff --git a/docs/hostconfig.md b/docs/hostconfig.md index 4b841d51..19cd4ca2 100644 --- a/docs/hostconfig.md +++ b/docs/hostconfig.md @@ -111,6 +111,8 @@ for example: container process will run as. * devices (list): Host device bindings. See [host devices](host-devices.md) for more information. +* tmpfs: Temporary filesystems to mouunt. See [Using tmpfs](tmpfs.md) for more + information. **Returns** (dict) HostConfig dictionary diff --git a/docs/tmpfs.md b/docs/tmpfs.md new file mode 100644 index 00000000..34dadd9e --- /dev/null +++ b/docs/tmpfs.md @@ -0,0 +1,32 @@ +# Using Tmpfs + +Tmpfs declaration is done with the `Client().create_container()` +method by declaring the mountpoints in the `host_config` section. + +This is available from docker 1.10. + +You can provide a list of declarations similar to the `--tmpfs` +option of the docker commandline client: + +```python +container_id = cli.create_container( + 'busybox', 'ls', + host_config=cli.create_host_config(tmpfs=[ + '/mnt/vol2', + '/mnt/vol1:size=3G,uid=1000' + ]) +) +``` + +You can alternatively specify tmpfs as a dict the docker remote +API uses: + +```python +container_id = cli.create_container( + 'busybox', 'ls', + host_config=cli.create_host_config(tmpfs={ + '/mnt/vol2': '', + '/mnt/vol1': 'size=3G,uid=1000' + }) +) +```