From 29d865788799850ef1c6a34515d7f83be1999dd6 Mon Sep 17 00:00:00 2001 From: Andrew Reusch Date: Thu, 13 May 2021 15:24:55 -0700 Subject: [PATCH] Always docker/build.sh with --no-cache. * Almost every docker container starts with apt-get install foo bar * This is inherently not cacheable, meanwhile the lack of --no-cache has bitten nearly everyone I've talked to who's tried to rebuild. * Adding now to address this repeated problem. --- docker/build.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docker/build.sh b/docker/build.sh index d574e2078623..e654a6253317 100755 --- a/docker/build.sh +++ b/docker/build.sh @@ -74,9 +74,12 @@ if [[ "$1" == "--net=host" ]]; then shift 1 fi +DOCKER_NO_CACHE_ARG=--no-cache + if [[ "$1" == "--cache-from" ]]; then shift 1 cached_image="$1" + DOCKER_NO_CACHE_ARG= CI_DOCKER_BUILD_EXTRA_PARAMS+=("--cache-from tvm.$CONTAINER_TYPE") CI_DOCKER_BUILD_EXTRA_PARAMS+=("--cache-from $cached_image") shift 1 @@ -154,6 +157,7 @@ echo "" # Build the docker container. echo "Building container (${DOCKER_IMG_NAME})..." docker build -t ${DOCKER_IMG_SPEC} \ + ${DOCKER_NO_CACHE_ARG} \ -f "${DOCKERFILE_PATH}" \ ${CI_DOCKER_BUILD_EXTRA_PARAMS[@]} \ "${DOCKER_CONTEXT_PATH}"