修改ubuntu docker timezone

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/think_ycx/article/details/83246458

搜了30min解决的,记录一下。

# check now  timezone
$ date -R
Sun, 21 Oct 2018 23:35:04 +0800


# change timezone to Shanghai if it is wrong
apt-get update
apt-get install tzdata

echo "Asia/Shanghai" > /etc/timezone
rm -f /etc/localtime
# maybe you need to rm -rf  /usr/share/zoneinfo/UTC
dpkg-reconfigure -f noninteractive tzdata

# output
Current default time zone: 'Asia/Shanghai'
Local time is now:      Sun Oct 21 22:33:36 CST 2018.
Universal Time is now:  Sun Oct 21 14:33:36 UTC 2018.

参考:https://stackoverflow.com/questions/40234847/docker-timezone-in-ubuntu-16-04-image

猜你喜欢

转载自blog.csdn.net/think_ycx/article/details/83246458