Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set timezone in Liberty container #359

Open
faandg opened this issue Sep 29, 2020 · 6 comments
Open

Set timezone in Liberty container #359

faandg opened this issue Sep 29, 2020 · 6 comments
Assignees

Comments

@faandg
Copy link

faandg commented Sep 29, 2020

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.

@arthurdm
Copy link
Contributor

hey @arturdzm - can you please take a look into this one?

@faandg
Copy link
Author

faandg commented Nov 12, 2020

Same question for locale.

@faandg
Copy link
Author

faandg commented Nov 19, 2020

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

@bbarman4u
Copy link

bbarman4u commented Feb 12, 2021

@arturdzm or any one is there an official answer on it for the ubuntu and UBI based images respectively ? I ended up following @faandg' solution and used the below tag to set the time zone -
# Set Time Zone ENV TZ America/Chicago

@arturdzm
Copy link
Contributor

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.

@faandg
Copy link
Author

faandg commented Feb 26, 2021

@arthurdm @arturdzm would it be possible to add some information about this to the readme?
I think this is generally the place where people expect to find something about TZ or LANG settings (as some image creators choose to make them configurable).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants