Created
January 23, 2017 02:11
-
-
Save sidja/833eb9824ada2684773553824f28e910 to your computer and use it in GitHub Desktop.
How to change time zone in docker container ubuntu
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM ubuntu:16.04 | |
ENV TZ=Australia/Melbourne | |
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone | |
RUN dpkg-reconfigure --frontend noninteractive tzdata |
Thank you for this, sidja and peter. Really helpful.
thanks!!!!
Very Good. Complete with this solution.
thanks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When running this
Dockerfile
during Docker building image onUbuntu 18.04
orUbuntu 16.04
, it will present following error message:It seems that the
tzdata
is not installed on Ubuntu 18.04 or Ubuntu 16.04.To fix this problem, the
Dockerfile
should change into following snippets: