方法一
在制作容器镜像时候,将时区问题解决
RUN rm -f /etc/localtime && ln -sv /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && echo "Asia/Shanghai" > /etc/timezone
方法二
采用hostpath方式将主机时区挂载至容器内部
volumeMounts:
- mountPath: /etc/localtime
name: time_name
volumes:
- hostPath:
path: /usr/share/zoneinfo/Asia/Shanghai
type: ''
name: time_name
