From 8fb6f75402ffeae71d5d1721e60237c047263ad9 Mon Sep 17 00:00:00 2001 From: Blagovest Petrov Date: Tue, 11 Oct 2016 02:57:32 +0300 Subject: [PATCH] Added an optional timezone configuration with the TZ ENV variable --- Dockerfile | 2 +- docker-entrypoint.sh | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 9389c372..f68fbc08 100644 --- a/Dockerfile +++ b/Dockerfile @@ -19,7 +19,7 @@ RUN set -ex \ && apk update \ && apk add build-base python-dev py-pip jpeg-dev jpeg zlib zlib-dev \ postgresql-dev libmcrypt-dev libmcrypt libpng-dev libpng \ - autoconf make g++ gcc git file gnupg re2c icu icu-dev \ + autoconf make g++ gcc git file gnupg re2c icu icu-dev tzdata \ #&& echo "@testing http://dl-cdn.alpinelinux.org/alpine/edge/testing" >> /etc/apk/repositories \ #&& echo '@community http://nl.alpinelinux.org/alpine/edge/community' >> /etc/apk/repositories \ #&& apk add php7-session@community \ diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh index 8a21ccc2..3580f5cc 100755 --- a/docker-entrypoint.sh +++ b/docker-entrypoint.sh @@ -6,4 +6,8 @@ if [ ! -e '/var/www/html/version.php' ]; then chown -R www-data /var/www/html fi +if [ -n "$TZ"]; then + cp /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone +fi + exec "$@"