Skip to content

Commit

Permalink
infra: make it possible to cache docker containers build (google#12284)
Browse files Browse the repository at this point in the history
Signed-off-by: David Korczynski <[email protected]>
  • Loading branch information
DavidKorczynski authored Aug 2, 2024
1 parent e409cd2 commit 3beb664
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions infra/helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -721,9 +721,14 @@ def docker_run(run_args, print_output=True, architecture='x86_64'):
"""Calls `docker run`."""
platform = 'linux/arm64' if architecture == 'aarch64' else 'linux/amd64'
command = [
'docker', 'run', '--rm', '--privileged', '--shm-size=2g', '--platform',
platform
'docker', 'run', '--privileged', '--shm-size=2g', '--platform', platform
]
if os.getenv('OSS_FUZZ_SAVE_CONTAINERS_NAME'):
command.append('--name')
command.append(os.getenv('OSS_FUZZ_SAVE_CONTAINERS_NAME'))
else:
command.append('--rm')

# Support environments with a TTY.
if sys.stdin.isatty():
command.append('-i')
Expand Down

0 comments on commit 3beb664

Please sign in to comment.