wiki:jazz/18-02-06

Version 1 (modified by jazz, 7 years ago) (diff)

--

2018-02-06

docker

  • docker timezone 設定

[CASE 1] 在原本 Host OS 的 Time Zone 是 UTC/GMT 的環境上

~$ date; docker run --rm alpine date; docker run --rm -e TZ=Asia/Taipei alpine date; docker run --rm debian date; docker run --rm -e TZ=Asia/Taipei debian date; docker run --rm centos date; docker run --rm -e TZ=Asia/Taipei centos date
Tue Feb  6 06:36:36 UTC 2018
Tue Feb  6 06:36:36 UTC 2018
Tue Feb  6 06:36:37 GMT 2018
Tue Feb  6 06:36:37 UTC 2018
Tue Feb  6 14:36:38 CST 2018
Tue Feb  6 06:36:38 UTC 2018
Tue Feb  6 14:36:38 CST 2018

[CASE 1] 在原本 Host OS 的 Time Zone 是 Asia/Taipei?(GMT+8) 的環境上

~]$ date; docker run --rm alpine date; docker run --rm -e TZ=Asia/Taipei alpine date; docker run --rm debian date; docker run --rm -e TZ=Asia/Taipei debian date; docker run --rm centos date; docker run --rm -e TZ=Asia/Taipei centos date
二  2月  6 14:40:42 CST 2018
Tue Feb  6 06:40:43 UTC 2018
Tue Feb  6 06:40:43 GMT 2018
Tue Feb  6 06:40:44 UTC 2018
Tue Feb  6 14:40:44 CST 2018
Tue Feb  6 06:40:44 UTC 2018
Tue Feb  6 14:40:45 CST 2018