Skip to content

Commit 3e60713

Browse files
committed
Make a specific tmp dir for container
1 parent 9fe974b commit 3e60713

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

tools/container.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import os
2+
import tempfile
23

34
from ptscripts import Context, command_group
45

@@ -38,6 +39,7 @@ def create(ctx: Context, image: str, name: str = ""):
3839
workdir = "/salt"
3940
home = "/root"
4041
network = "ip6net"
42+
tmpdir = tempfile.mkdtemp(prefix="salt-test-container")
4143
if not onci and not has_network(ctx, network):
4244
ctx.info(f"Creating docker network: {network}")
4345
create_network(ctx, network)
@@ -80,6 +82,8 @@ def create(ctx: Context, image: str, name: str = ""):
8082
f"--name={name}",
8183
"--privileged",
8284
f"--workdir={workdir}",
85+
"-v",
86+
f"{tmpdir}:/var/lib/docker",
8387
]
8488
for key in env:
8589
cmd.extend(["-e", f"{key}={env[key]}"])

0 commit comments

Comments
 (0)