Skip to content

Instantly share code, notes, and snippets.

@jtr109
Last active June 16, 2019 04:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jtr109/21cb7ef7c79034b2ad63df8afb03e7cb to your computer and use it in GitHub Desktop.
Save jtr109/21cb7ef7c79034b2ad63df8afb03e7cb to your computer and use it in GitHub Desktop.
change timezone in dockerfile
FROM alpine:3.9
RUN apk add --no-cache tzdata //
ENV TZ=Asia/Shanghai
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
CMD date
FROM ubuntu:18.04
ENV TZ=Asia/Shanghai
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
CMD date
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment