mirror of
https://github.com/rustfs/rustfs.git
synced 2026-08-10 15:16:56 +00:00
d7f014cf5f
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>
25 lines
676 B
Bash
Executable File
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
|