Kaydet (Commit) a0545092 authored tarafından Aanand Prasad's avatar Aanand Prasad

Reword tmpfs documentation

Signed-off-by: 's avatarAanand Prasad <aanand.prasad@gmail.com>
üst 07455a6a
# 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'
})
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment