summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAanand Prasad <aanand.prasad@gmail.com>2016-03-16 15:01:17 +0000
committerAanand Prasad <aanand.prasad@gmail.com>2016-03-16 15:07:53 +0000
commita0545092691948fcae34112384c9fc7a5628ca16 (patch)
treea773e9814dea65ad0cfe1f0f8168e6a33ca5c3c7
parent07455a6a3c92b2c642d340b3356a20c386ad97dc (diff)
downloaddocker-py-a0545092691948fcae34112384c9fc7a5628ca16.tar.gz
Reword tmpfs documentation
Signed-off-by: Aanand Prasad <aanand.prasad@gmail.com>
-rw-r--r--docs/tmpfs.md25
1 files changed, 13 insertions, 12 deletions
diff --git a/docs/tmpfs.md b/docs/tmpfs.md
index 34dadd9..d8be9b6 100644
--- a/docs/tmpfs.md
+++ b/docs/tmpfs.md
@@ -1,30 +1,31 @@
-# Using Tmpfs
+# Using tmpfs
-Tmpfs declaration is done with the `Client().create_container()`
-method by declaring the mountpoints in the `host_config` section.
+When creating a container, you can specify paths to be mounted with tmpfs using
+the `tmpfs` argument to `create_host_config`, similarly to the `--tmpfs`
+argument to `docker run`.
-This is available from docker 1.10.
+This capability is supported in Docker Engine 1.10 and up.
-You can provide a list of declarations similar to the `--tmpfs`
-option of the docker commandline client:
+`tmpfs` can be either a list or a dictionary. If it's a list, each item is a
+string specifying the path and (optionally) any configuration for the mount:
```python
-container_id = cli.create_container(
+client.create_container(
'busybox', 'ls',
- host_config=cli.create_host_config(tmpfs=[
+ host_config=client.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:
+Alternatively, if it's a dictionary, each key is a path and each value contains
+the mount options:
```python
-container_id = cli.create_container(
+client.create_container(
'busybox', 'ls',
- host_config=cli.create_host_config(tmpfs={
+ host_config=client.create_host_config(tmpfs={
'/mnt/vol2': '',
'/mnt/vol1': 'size=3G,uid=1000'
})