From 54599f142de6da6dd4f230f0abeef99166628443 Mon Sep 17 00:00:00 2001 From: Gerwin Klein Date: Sun, 24 Mar 2024 12:02:49 +0100 Subject: [PATCH] build: report on-disk size of built images Signed-off-by: Gerwin Klein --- build.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/build.sh b/build.sh index 6a087de..34abf6e 100755 --- a/build.sh +++ b/build.sh @@ -33,6 +33,7 @@ set -ef # Extra vars DOCKER_BUILD="docker build" +DOCKER_INSPECT="docker inspect" DOCKER_FLAGS="--force-rm=true" # Special variables to be passed through Docker to the build scripts @@ -69,6 +70,9 @@ build_internal_image() -t "$img_name" \ "$@" \ . + + echo "Size of $img_name:" + $DOCKER_INSPECT inspect -f "{{ .Size }}" "$img_name" | xargs printf "%'d\n" } build_image() @@ -99,6 +103,9 @@ apply_software_to_image() -t "$DOCKERHUB$new_img" \ "$@" \ . + + echo "Size of $new_img:" + $DOCKER_INSPECT inspect -f "{{ .Size }}" "$new_img" | xargs printf "%'d\n" } ############################################