Skip to content

Commit 3beb664

Browse files
infra: make it possible to cache docker containers build (#12284)
Signed-off-by: David Korczynski <[email protected]>
1 parent e409cd2 commit 3beb664

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

infra/helper.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -721,9 +721,14 @@ def docker_run(run_args, print_output=True, architecture='x86_64'):
721721
"""Calls `docker run`."""
722722
platform = 'linux/arm64' if architecture == 'aarch64' else 'linux/amd64'
723723
command = [
724-
'docker', 'run', '--rm', '--privileged', '--shm-size=2g', '--platform',
725-
platform
724+
'docker', 'run', '--privileged', '--shm-size=2g', '--platform', platform
726725
]
726+
if os.getenv('OSS_FUZZ_SAVE_CONTAINERS_NAME'):
727+
command.append('--name')
728+
command.append(os.getenv('OSS_FUZZ_SAVE_CONTAINERS_NAME'))
729+
else:
730+
command.append('--rm')
731+
727732
# Support environments with a TTY.
728733
if sys.stdin.isatty():
729734
command.append('-i')

0 commit comments

Comments
 (0)