Files
rustfs/scripts/test_docker_runtime_timezone.sh
T
Ramakrishna Chilaka d7f014cf5f fix(docker): support TZ environment variable (#5891)
Install tzdata in both published runtime variants and verify IANA timezone resolution during image builds.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-08-09 21:54:59 +08:00

25 lines
676 B
Bash
Executable File

#!/usr/bin/env bash
set -euo pipefail
ROOT_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)
for dockerfile in Dockerfile Dockerfile.glibc; do
runtime_stage=$(
awk '
/^FROM[[:space:]]/ { stage = "" }
{ stage = stage $0 ORS }
END { printf "%s", stage }
' "$ROOT_DIR/$dockerfile"
)
if ! grep -Eq '^[[:space:]]*tzdata([[:space:]]*\\)?[[:space:]]*$' <<<"$runtime_stage"; then
echo "$dockerfile runtime stage must install tzdata" >&2
exit 1
fi
if ! grep -Fq 'test "$(TZ=Asia/Kolkata date +%z)" = "+0530"' <<<"$runtime_stage"; then
echo "$dockerfile runtime stage must verify IANA timezone resolution" >&2
exit 1
fi
done