mirror of
https://github.com/n30nex/CartoLite-Server.git
synced 2026-10-16 07:19:54 +00:00
10 lines
289 B
Bash
10 lines
289 B
Bash
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
|
|
image="${1:?usage: check-image-size.sh IMAGE}"
|
|
limit="${CARTOLITE_IMAGE_SIZE_BUDGET:-52428800}"
|
|
size="$(docker image inspect "$image" --format '{{.Size}}')"
|
|
[[ "$size" =~ ^[0-9]+$ ]]
|
|
echo "$size image bytes (budget $limit)"
|
|
test "$size" -le "$limit"
|