mirror of https://github.com/docker/docker-py.git
Add documentation for the Tmpfs Hostconfig option.
Signed-off-by: Jan Losinski <losinski@wh2.tu-dresden.de>
This commit is contained in:
parent
72446b47c0
commit
88ef5f3630
|
@ -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
|
||||
|
||||
|
|
|
@ -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'
|
||||
})
|
||||
)
|
||||
```
|
Loading…
Reference in New Issue