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