Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- RUN sudo echo "America/Los_Angeles" > /etc/timezone
- docker run -v /etc/timezone:/etc/timezone [image-name]
- $ cat /etc/timezone
- America/Los_Angeles
- $ date
- Tue Apr 14 23:46:51 UTC 2015
- ENV TZ=America/Los_Angeles
- RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
- docker run -e TZ=Europe/Amsterdam debian:jessie date
- # Relocate the timezone file
- RUN mkdir -p /config/etc && mv /etc/timezone /config/etc/ && ln -s /config/etc/timezone /etc/
- # Set timezone as specified in /config/etc/timezone
- dpkg-reconfigure -f noninteractive tzdata
- # Set the time zone
- RUN echo "Europe/London" > /config/etc/timezone
- volumes:
- - "/etc/timezone:/etc/timezone:ro"
- - "/etc/localtime:/etc/localtime:ro"
- ENV TZ 'Europe/Tallinn'
- RUN echo $TZ > /etc/timezone &&
- apt-get update && apt-get install -y tzdata &&
- rm /etc/localtime &&
- ln -snf /usr/share/zoneinfo/$TZ /etc/localtime &&
- dpkg-reconfigure -f noninteractive tzdata &&
- apt-get clean
- >docker run -it ubuntu:trusty /bin/bash
- #dpkg-reconfigure tzdata
- >docker commit [container-id] chocko/ubuntu:local
- FROM chocko/ubuntu:local
- # Change the docker default timezone from UTC to SGT
- echo "Asia/Singapore" > /etc/timezone
- dpkg-reconfigure tzdata
- date
- ENV TZ=America/Toronto
- RUN apk update
- RUN apk upgrade
- RUN apk add ca-certificates && update-ca-certificates
- RUN apk add --update tzdata
- RUN rm -rf /var/cache/apk/*
Add Comment
Please, Sign In to add comment