diff --git a/infra/helper.py b/infra/helper.py index 85e26026d..1d03de9e8 100755 --- a/infra/helper.py +++ b/infra/helper.py @@ -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')