From 37aad2a29a6212178b60f9ea31394fc0dc424343 Mon Sep 17 00:00:00 2001 From: Eric Anderson Date: Tue, 22 Sep 2015 18:46:12 -0700 Subject: [PATCH] Prevent failed docker builds from accumulating By default docker does not clean up temporary images when the build fails to allow the user to inspect the state of the container to determine what went wrong. Those images don't help us at all and just accumulate until disk usage is 100%. --- tools/gce_setup/shared_startup_funcs.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/gce_setup/shared_startup_funcs.sh b/tools/gce_setup/shared_startup_funcs.sh index ffa08751535..a0b45e94587 100755 --- a/tools/gce_setup/shared_startup_funcs.sh +++ b/tools/gce_setup/shared_startup_funcs.sh @@ -448,7 +448,7 @@ grpc_dockerfile_install() { } # TODO(temiola): maybe make cache/no-cache a func option? - sudo docker build $cache_opt -t $image_label $dockerfile_dir || { + sudo docker build --force-rm=true $cache_opt -t $image_label $dockerfile_dir || { echo "$FUNCNAME:: build of $image_label <- $dockerfile_dir" return 1 }