The solution to the inconsistency between the time zone of the docker container and the host

Under normal circumstances, the time zone of our host server is in the East Eighth District, while the Docker container is in the zero time zone. This results in a time difference of 8 hours, so it is necessary to set the time of the container to the East Eighth District.

The settings in the dockerfile are as follows:
RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime  
RUN echo "Asia/Shanghai" > /etc/timezone  
RUN dpkg-reconfigure -f noninteractive tzdata  



Reprint http://blog.csdn.net/redstarofsleep/article/details/60871292

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326389883&siteId=291194637