Dockerfile中修改ubuntu 18.04时区

# check now  timezone
$ date -R
Sun, 21 Oct 2018 23:35:04 +0800
 
 
# change timezone to Shanghai if it is wrong
apt update
apt install -y 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.
上一篇:ubuntu常用命令&&易错命令


下一篇:WARN: Caught while disconnecting... EXCEPTION STACK TRACE: ** BEGIN NESTED EXCEPTION **