mirror of
https://github.com/rustfs/rustfs.git
synced 2026-08-11 15:46:53 +00:00
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>
This commit is contained in:
committed by
GitHub
parent
8f9633ee83
commit
d7f014cf5f
Executable
+24
@@ -0,0 +1,24 @@
|
||||
#!/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
|
||||
Reference in New Issue
Block a user