Skip to content

Commit

Permalink
Add "--rm" flag to docker run invocations in run.py
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
rlee287 authored Jan 25, 2023
1 parent 31f0efa commit 52281ab
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions ectf_tools/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ async def unlock(

ret = await run_shell(
"docker run"
" --rm"
" --add-host ectf-net:host-gateway"
f" -v {image}.{name}.tools.vol:/tools_out:ro"
" --workdir=/tools_out"
Expand Down Expand Up @@ -65,6 +66,7 @@ async def pair(

ret = await run_shell(
"docker run"
" --rm"
" --add-host ectf-net:host-gateway"
f" -v {image}.{name}.tools.vol:/tools_out:ro"
" --workdir=/tools_out"
Expand Down Expand Up @@ -97,6 +99,7 @@ async def package(

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

ret = await run_shell(
"docker run"
" --rm"
" --add-host ectf-net:host-gateway"
f" -v {image}.{name}.tools.vol:/tools_out:ro"
" --workdir=/tools_out"
Expand Down

0 comments on commit 52281ab

Please sign in to comment.