File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -65,8 +65,6 @@ RUN apk update --no-cache && \
6565 zip && \
6666 # Install NodeJS only for openHAB >= 5
6767 if [ "$(echo $OPENHAB_VERSION | sed -E 's/^([0-9]+).*/\1 /')" -ge 5 ]; then apk add --no-cache nodejs; fi && \
68- # Configure default time zone
69- ln -sf /usr/share/zoneinfo/$TZ /etc/localtime && \
7068 # Fix issue with (arp)ping tool under non-root user for Docker+LXC setups
7169 # See: https://community.openhab.org/t/network-pingdevice-breaks-after-4-3-6-5-0-1-update-docker/166175
7270 chmod u+s /bin/ping && \
Original file line number Diff line number Diff line change @@ -5,8 +5,21 @@ set -eux -o pipefail ${EXTRA_SHELL_OPTS-}
55IFS=$' \n\t '
66
77# Configure time zone
8- ln -sf /usr/share/zoneinfo/$TZ /etc/localtime
8+ if [ -n " ${TZ:- } " ]; then
9+ if grep -q " /etc/localtime " /proc/self/mountinfo; then
10+ echo " Warning: /etc/localtime is mounted. Please remove this volume mount and use the TZ environment variable instead."
11+ else
12+ if [ ! -f " /usr/share/zoneinfo/${TZ} " ]; then
13+ echo " Error: Invalid timezone '${TZ} ' set in TZ environment variable" >&2
14+ exit 1
15+ fi
16+ ln -sf " /usr/share/zoneinfo/${TZ} " /etc/localtime
17+ fi
18+ else
19+ echo " TZ environment variable is not set. Skipping time zone configuration."
20+ fi
921
22+ # Determine Java home directory independent of JVM vendor, version and environment variables
1023export JAVA_HOME=$( find /usr/lib/jvm -mindepth 1 -maxdepth 1 -type d)
1124
1225# Configure Java unlimited strength cryptography
Original file line number Diff line number Diff line change @@ -5,8 +5,21 @@ set -eux -o pipefail ${EXTRA_SHELL_OPTS-}
55IFS=$' \n\t '
66
77# Configure time zone
8- ln -sf /usr/share/zoneinfo/$TZ /etc/localtime
8+ if [ -n " ${TZ:- } " ]; then
9+ if mountpoint -q /etc/localtime; then
10+ echo " Warning: /etc/localtime is mounted. Please remove this volume mount and use the TZ environment variable instead."
11+ else
12+ if [ ! -f " /usr/share/zoneinfo/${TZ} " ]; then
13+ echo " Error: Invalid timezone '${TZ} ' set in TZ environment variable" >&2
14+ exit 1
15+ fi
16+ ln -sf " /usr/share/zoneinfo/${TZ} " /etc/localtime
17+ fi
18+ else
19+ echo " TZ environment variable is not set. Skipping time zone configuration."
20+ fi
921
22+ # Determine Java home directory independent of JVM vendor, version and environment variables
1023export JAVA_HOME=$( find /usr/lib/jvm -mindepth 1 -maxdepth 1 -type d)
1124
1225# Configure Java unlimited strength cryptography
You can’t perform that action at this time.
0 commit comments