docker icon indicating copy to clipboard operation
docker copied to clipboard

Unable to change timezone

Open eKristensen opened this issue 8 years ago • 3 comments

I cannot change the timezone inside the docker. the TZ variable is ignored and the typical files for setting the timezone is also ignored /etc/timezone and /etc/localtime

Its set to UTC as per default, but as i live en the Europe/Copenhagen timezone, its two hours offset.

How do i change that?

eKristensen avatar Aug 06 '17 10:08 eKristensen

See https://github.com/gliderlabs/docker-alpine/issues/136, there is currently no direct support for changing timezone in our container.

nijel avatar Aug 06 '17 13:08 nijel

Okay...

eKristensen avatar Aug 06 '17 13:08 eKristensen

I didn't want to say it doesn't make sense to add it though :-).

nijel avatar Aug 06 '17 13:08 nijel

why not this?

ENV MAX_EXECUTION_TIME 600
ENV MEMORY_LIMIT 512M
ENV UPLOAD_LIMIT 2048K
ENV TZ UTC                     #<===
RUN set -ex; \
    \
    { \
        echo 'opcache.memory_consumption=128'; \
        echo 'opcache.interned_strings_buffer=8'; \
        echo 'opcache.max_accelerated_files=4000'; \
        echo 'opcache.revalidate_freq=2'; \
        echo 'opcache.fast_shutdown=1'; \
    } > $PHP_INI_DIR/conf.d/opcache-recommended.ini; \
    \
    { \
        echo 'session.cookie_httponly=1'; \
        echo 'session.use_strict_mode=1'; \
    } > $PHP_INI_DIR/conf.d/session-strict.ini; \
    \
    { \
        echo 'allow_url_fopen=Off'; \
        echo 'max_execution_time=${MAX_EXECUTION_TIME}'; \
        echo 'max_input_vars=10000'; \
        echo 'memory_limit=${MEMORY_LIMIT}'; \
        echo 'post_max_size=${UPLOAD_LIMIT}'; \
        echo 'upload_max_filesize=${UPLOAD_LIMIT}'; \
        echo 'date.timezone=${TZ}'; \                                 #<===
    } > $PHP_INI_DIR/conf.d/phpmyadmin-misc.ini

Sergio-IME avatar Jan 20 '23 14:01 Sergio-IME

See #394

williamdes avatar Jan 26 '23 08:01 williamdes