Add documentation for the Tmpfs Hostconfig option.

Signed-off-by: Jan Losinski <losinski@wh2.tu-dresden.de>
This commit is contained in:
Jan Losinski 2016-02-11 19:20:30 +01:00 committed by Aanand Prasad
parent 72446b47c0
commit 88ef5f3630
2 changed files with 34 additions and 0 deletions

View File

@ -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

32
docs/tmpfs.md Normal file
View File

@ -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'
})
)
```