docker容器时区与宿主机不一致的解决方法

一般情况下,我们的宿主机服务器的时区都是在东八区,而Docker容器里却是在零时区。这样就导致了时间差了8个小时,所以需要把容器的时间也设置成东八区。

在dockerfile中的设置如下:
RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime  
RUN echo "Asia/Shanghai" > /etc/timezone  
RUN dpkg-reconfigure -f noninteractive tzdata  



转载 http://blog.csdn.net/redstarofsleep/article/details/60871292

猜你喜欢

转载自liang100100.iteye.com/blog/2366384