-
-
Save peter279k/610b0b45abfd716b655d8b740ed878e7 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 |
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: