方式1: Dockerfile中添加以下命令 RUN apt-get -y install tzdata RUN echo 'Asia/Shanghai' > /etc/timezone RUN dpkg-reconfigure -f noninteractive tzdata RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime 方式2: 同步宿主机时区 将宿主机时区配置文件挂载到容器中 - /etc/localtime:/etc/localtime:ro - /etc/timezone:/etc/timezone:ro