From 717dd24af97e8ee1683015a32f5796a85c7f79dc Mon Sep 17 00:00:00 2001 From: Pedro Larroy Date: Tue, 2 Jul 2019 00:58:16 +0000 Subject: [PATCH] Add -R option to ci/build.py to avoid rebuilding containers There are a couple of problems which trigger continuous rebuild of the containers which have difficult solutions, this option enables a workaround. https://github.com/docker/docker.github.io/issues/8886 --- ci/build.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/ci/build.py b/ci/build.py index 3d6fb9b4d893..e6a183fefa34 100755 --- a/ci/build.py +++ b/ci/build.py @@ -416,6 +416,10 @@ def main() -> int: help="Only build the container, don't build the project", action='store_true') + parser.add_argument("-R", "--run-only", + help="Only run the container, don't rebuild the container", + action='store_true') + parser.add_argument("-a", "--all", help="build for all platforms", action='store_true') @@ -492,8 +496,12 @@ def signal_handler(signum, _): tag = get_docker_tag(platform=platform, registry=args.docker_registry) if args.docker_registry: load_docker_cache(tag=tag, docker_registry=args.docker_registry) - build_docker(platform=platform, docker_binary=docker_binary, registry=args.docker_registry, + if not args.run_only: + build_docker(platform=platform, docker_binary=docker_binary, registry=args.docker_registry, num_retries=args.docker_build_retries, no_cache=args.no_cache) + else: + logging.info("Skipping docker build step.") + if args.build_only: logging.warning("Container was just built. Exiting due to build-only.") return 0