Skip to content

Commit

Permalink
build: report on-disk size of built images
Browse files Browse the repository at this point in the history
Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
  • Loading branch information
lsf37 committed Mar 24, 2024
1 parent 120c213 commit 54599f1
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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()
Expand Down Expand Up @@ -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"
}
############################################

Expand Down

0 comments on commit 54599f1

Please sign in to comment.