Skip to content

Commit 88ef5f3

Browse files
janLoaanand
authored andcommitted
Add documentation for the Tmpfs Hostconfig option.
Signed-off-by: Jan Losinski <[email protected]>
1 parent 72446b4 commit 88ef5f3

File tree

2 files changed

+34
-0
lines changed

2 files changed

+34
-0
lines changed

docs/hostconfig.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,8 @@ for example:
111111
container process will run as.
112112
* devices (list): Host device bindings. See [host devices](host-devices.md)
113113
for more information.
114+
* tmpfs: Temporary filesystems to mouunt. See [Using tmpfs](tmpfs.md) for more
115+
information.
114116

115117
**Returns** (dict) HostConfig dictionary
116118

docs/tmpfs.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Using Tmpfs
2+
3+
Tmpfs declaration is done with the `Client().create_container()`
4+
method by declaring the mountpoints in the `host_config` section.
5+
6+
This is available from docker 1.10.
7+
8+
You can provide a list of declarations similar to the `--tmpfs`
9+
option of the docker commandline client:
10+
11+
```python
12+
container_id = cli.create_container(
13+
'busybox', 'ls',
14+
host_config=cli.create_host_config(tmpfs=[
15+
'/mnt/vol2',
16+
'/mnt/vol1:size=3G,uid=1000'
17+
])
18+
)
19+
```
20+
21+
You can alternatively specify tmpfs as a dict the docker remote
22+
API uses:
23+
24+
```python
25+
container_id = cli.create_container(
26+
'busybox', 'ls',
27+
host_config=cli.create_host_config(tmpfs={
28+
'/mnt/vol2': '',
29+
'/mnt/vol1': 'size=3G,uid=1000'
30+
})
31+
)
32+
```

0 commit comments

Comments
 (0)