Guest User

Untitled

a guest
Apr 24th, 2018
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.43 KB | None | 0 0
  1. RUN sudo echo "America/Los_Angeles" > /etc/timezone
  2.  
  3. docker run -v /etc/timezone:/etc/timezone [image-name]
  4.  
  5. $ cat /etc/timezone
  6. America/Los_Angeles
  7. $ date
  8. Tue Apr 14 23:46:51 UTC 2015
  9.  
  10. ENV TZ=America/Los_Angeles
  11. RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
  12.  
  13. docker run -e TZ=Europe/Amsterdam debian:jessie date
  14.  
  15. # Relocate the timezone file
  16. RUN mkdir -p /config/etc && mv /etc/timezone /config/etc/ && ln -s /config/etc/timezone /etc/
  17.  
  18. # Set timezone as specified in /config/etc/timezone
  19. dpkg-reconfigure -f noninteractive tzdata
  20.  
  21. # Set the time zone
  22. RUN echo "Europe/London" > /config/etc/timezone
  23.  
  24. volumes:
  25. - "/etc/timezone:/etc/timezone:ro"
  26. - "/etc/localtime:/etc/localtime:ro"
  27.  
  28. ENV TZ 'Europe/Tallinn'
  29. RUN echo $TZ > /etc/timezone &&
  30. apt-get update && apt-get install -y tzdata &&
  31. rm /etc/localtime &&
  32. ln -snf /usr/share/zoneinfo/$TZ /etc/localtime &&
  33. dpkg-reconfigure -f noninteractive tzdata &&
  34. apt-get clean
  35.  
  36. >docker run -it ubuntu:trusty /bin/bash
  37. #dpkg-reconfigure tzdata
  38.  
  39. >docker commit [container-id] chocko/ubuntu:local
  40.  
  41. FROM chocko/ubuntu:local
  42.  
  43. # Change the docker default timezone from UTC to SGT
  44. echo "Asia/Singapore" > /etc/timezone
  45. dpkg-reconfigure tzdata
  46. date
  47.  
  48. ENV TZ=America/Toronto
  49. RUN apk update
  50. RUN apk upgrade
  51. RUN apk add ca-certificates && update-ca-certificates
  52. RUN apk add --update tzdata
  53. RUN rm -rf /var/cache/apk/*
Add Comment
Please, Sign In to add comment