Set timezone in Liberty container
Opened this issue · 6 comments
Greetings,
We noticed there is a tzdata package installed by default in the container, yet we did not find a way to properly change the timezone.
Is there a recommended way to do this (dockerfile run command / arg available / ...)?
In our case we are using OpenShift, but you might have a generic solution.
Thanks in advance.
Same question for locale.
Not sure if this is the way to go, but currently we're going with setting timezone and locale in the Dockerfile;
USER root
RUN dnf -y remove glibc-minimal-langpack \
&& dnf -y install glibc-locale-source glibc-all-langpacks \
&& localedef --force -i nl_BE -f UTF-8 nl_BE.UTF-8 \
&& dnf clean all
ENV LANG nl_BE.UTF-8
ENV LC_ALL nl_BE.UTF-8
ENV TZ Europe/Brussels
Yes, this is general solution, the language packs must be installed on top of original image and if there are multiple you could switch locales at runtime with ENV variables.
For ubuntu based images the language packs can be installed by apt-get install language-pack-nl
for example.