Skip to content

Commit

Permalink
Add docu about image size (#140)
Browse files Browse the repository at this point in the history
  • Loading branch information
sschnabe authored Dec 5, 2023
1 parent 45e54a8 commit 4c60517
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 0 deletions.
21 changes: 21 additions & 0 deletions .github/print-size.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
export VERSION=$(mvn help:evaluate -Dexpression=version.org.keycloak -DforceStdout -q)
export REDHAT_RUNTIME=quay.io/keycloak/keycloak:$VERSION
export TEMURIN_RUNTIME=docker.io/kokuwaio/keycloak:$VERSION
export TEMURIN_IMPORT=docker.io/kokuwaio/keycloak:$VERSION-import
export DISTROLESS_RUNTIME=docker.io/kokuwaio/keycloak:$VERSION-distroless
export DISTROLESS_IMPORT=docker.io/kokuwaio/keycloak:$VERSION-distroless-import

docker pull --quiet=true $REDHAT_RUNTIME &
docker pull --quiet=true $TEMURIN_RUNTIME &
docker pull --quiet=true $TEMURIN_IMPORT &
docker pull --quiet=true $DISTROLESS_RUNTIME &
docker pull --quiet=true $DISTROLESS_IMPORT &
wait

printf "\n| image | uncompressed | compressed |\n"
printf "|------------------------------------------------------|-------------------|-------------------|\n"
printf "| %-52s | %'11d bytes | %'11d bytes |\n" $REDHAT_RUNTIME $(docker image inspect $REDHAT_RUNTIME --format='{{.Size}}') $(docker manifest inspect -v $REDHAT_RUNTIME | jq '.[] | select(.Descriptor.platform.architecture == "amd64").OCIManifest.layers[].size' | tr '\n' '+' | cat - <(echo "0") | bc)
printf "| %-52s | %'11d bytes | %'11d bytes |\n" $TEMURIN_RUNTIME $(docker image inspect $TEMURIN_RUNTIME --format='{{.Size}}') $(docker manifest inspect -v $TEMURIN_RUNTIME | jq '.[] | select(.Descriptor.platform.architecture == "amd64").OCIManifest.layers[].size' | tr '\n' '+' | cat - <(echo "0") | bc)
printf "| %-52s | %'11d bytes | %'11d bytes |\n" $TEMURIN_IMPORT $(docker image inspect $TEMURIN_IMPORT --format='{{.Size}}') $(docker manifest inspect -v $TEMURIN_IMPORT | jq '.[] | select(.Descriptor.platform.architecture == "amd64").OCIManifest.layers[].size' | tr '\n' '+' | cat - <(echo "0") | bc)
printf "| %-52s | %'11d bytes | %'11d bytes |\n" $DISTROLESS_RUNTIME $(docker image inspect $DISTROLESS_RUNTIME --format='{{.Size}}') $(docker manifest inspect -v $DISTROLESS_RUNTIME | jq '.[] | select(.Descriptor.platform.architecture == "amd64").OCIManifest.layers[].size' | tr '\n' '+' | cat - <(echo "0") | bc)
printf "| %-52s | %'11d bytes | %'11d bytes |\n" $DISTROLESS_IMPORT $(docker image inspect $DISTROLESS_IMPORT --format='{{.Size}}') $(docker manifest inspect -v $DISTROLESS_IMPORT | jq '.[] | select(.Descriptor.platform.architecture == "amd64").OCIManifest.layers[].size' | tr '\n' '+' | cat - <(echo "0") | bc)
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,21 @@ Tags:
- all tags are available with suffix `-import` for realm import without cache
- all tags are available with suffix `-temurin` or `-distroless` for specific base images

## Sizes

Created with [print-size.sh](/.github/print-size.sh): `.github/print-size.sh`

| image | uncompressed | compressed |
|------------------------------------------------------|-------------------|-------------------|
| quay.io/keycloak/keycloak:23.0.1 | 459.018.503 bytes | 262.181.076 bytes |
| docker.io/kokuwaio/keycloak:23.0.1 | 446.125.014 bytes | 256.232.904 bytes |
| docker.io/kokuwaio/keycloak:23.0.1-import | 446.043.228 bytes | 256.160.692 bytes |
| docker.io/kokuwaio/keycloak:23.0.1-distroless | 403.345.214 bytes | 254.675.552 bytes |
| docker.io/kokuwaio/keycloak:23.0.1-distroless-import | 403.263.428 bytes | 254.603.340 bytes |

- `compressed`: size transfered from registry
- `uncompressed`: size on disk

## Develop and testing

Start k3s: `mvn pre-integration-test`
Expand Down

0 comments on commit 4c60517

Please sign in to comment.