Skip to content

Commit a054509

Browse files
committed
Reword tmpfs documentation
Signed-off-by: Aanand Prasad <[email protected]>
1 parent 07455a6 commit a054509

File tree

1 file changed

+13
-12
lines changed

1 file changed

+13
-12
lines changed

docs/tmpfs.md

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,31 @@
1-
# Using Tmpfs
1+
# Using tmpfs
22

3-
Tmpfs declaration is done with the `Client().create_container()`
4-
method by declaring the mountpoints in the `host_config` section.
3+
When creating a container, you can specify paths to be mounted with tmpfs using
4+
the `tmpfs` argument to `create_host_config`, similarly to the `--tmpfs`
5+
argument to `docker run`.
56

6-
This is available from docker 1.10.
7+
This capability is supported in Docker Engine 1.10 and up.
78

8-
You can provide a list of declarations similar to the `--tmpfs`
9-
option of the docker commandline client:
9+
`tmpfs` can be either a list or a dictionary. If it's a list, each item is a
10+
string specifying the path and (optionally) any configuration for the mount:
1011

1112
```python
12-
container_id = cli.create_container(
13+
client.create_container(
1314
'busybox', 'ls',
14-
host_config=cli.create_host_config(tmpfs=[
15+
host_config=client.create_host_config(tmpfs=[
1516
'/mnt/vol2',
1617
'/mnt/vol1:size=3G,uid=1000'
1718
])
1819
)
1920
```
2021

21-
You can alternatively specify tmpfs as a dict the docker remote
22-
API uses:
22+
Alternatively, if it's a dictionary, each key is a path and each value contains
23+
the mount options:
2324

2425
```python
25-
container_id = cli.create_container(
26+
client.create_container(
2627
'busybox', 'ls',
27-
host_config=cli.create_host_config(tmpfs={
28+
host_config=client.create_host_config(tmpfs={
2829
'/mnt/vol2': '',
2930
'/mnt/vol1': 'size=3G,uid=1000'
3031
})

0 commit comments

Comments
 (0)