File tree Expand file tree Collapse file tree 2 files changed +34
-0
lines changed Expand file tree Collapse file tree 2 files changed +34
-0
lines changed Original file line number Diff line number Diff line change @@ -111,6 +111,8 @@ for example:
111
111
container process will run as.
112
112
* devices (list): Host device bindings. See [ host devices] ( host-devices.md )
113
113
for more information.
114
+ * tmpfs: Temporary filesystems to mouunt. See [ Using tmpfs] ( tmpfs.md ) for more
115
+ information.
114
116
115
117
** Returns** (dict) HostConfig dictionary
116
118
Original file line number Diff line number Diff line change
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
+ ```
You can’t perform that action at this time.
0 commit comments