查看主机时间

[root@localhost ~]# date
2016年 07月 27日 星期三 22:42:44 CST

查看容器时间

root@b43340ecf5ef:/# date                                                                                                                                                                                                                                                    
Wed Jul 27 14:43:31 UTC 2016

可以发现,他们相隔了8小时。

CST应该是指(China Shanghai Time,东八区时间) 
UTC应该是指(Coordinated Universal Time,标准时间) 
所以,这2个时间实际上应该相差8个小时。

 

解决方法:

  Dockerfile加入

  

RUN /bin/cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && echo 'Asia/Shanghai' >/etc/timezone 

 

相关文章:

  • 2021-12-30
  • 2022-12-23
  • 2021-07-30
  • 2021-06-28
  • 2021-05-21
  • 2022-12-23
  • 2021-06-10
  • 2022-12-23
猜你喜欢
  • 2021-04-22
  • 2022-12-23
  • 2022-02-24
  • 2022-12-23
  • 2021-06-21
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案