Skip to content

Commit 52281ab

Browse files
authored
Add "--rm" flag to docker run invocations in run.py
There wouldn't really be a need to inspect containers created by running host tools after running said host tools, and persistent state would need to go into the writable volumes anyways in order to be reused between runs. Removing the containers after each run reduces the disk space taken up by stopped containers.
1 parent 31f0efa commit 52281ab

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

ectf_tools/run.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ async def unlock(
3434

3535
ret = await run_shell(
3636
"docker run"
37+
" --rm"
3738
" --add-host ectf-net:host-gateway"
3839
f" -v {image}.{name}.tools.vol:/tools_out:ro"
3940
" --workdir=/tools_out"
@@ -65,6 +66,7 @@ async def pair(
6566

6667
ret = await run_shell(
6768
"docker run"
69+
" --rm"
6870
" --add-host ectf-net:host-gateway"
6971
f" -v {image}.{name}.tools.vol:/tools_out:ro"
7072
" --workdir=/tools_out"
@@ -97,6 +99,7 @@ async def package(
9799

98100
ret = await run_shell(
99101
"docker run"
102+
" --rm"
100103
" --add-host ectf-net:host-gateway"
101104
f" -v {image}.{name}.{deployment}.secrets.vol:/secrets"
102105
f" -v {image}.{name}.tools.vol:/tools_out:ro"
@@ -131,6 +134,7 @@ async def enable(
131134

132135
ret = await run_shell(
133136
"docker run"
137+
" --rm"
134138
" --add-host ectf-net:host-gateway"
135139
f" -v {image}.{name}.tools.vol:/tools_out:ro"
136140
" --workdir=/tools_out"

0 commit comments

Comments
 (0)