即使通过CoreOS在timedatectl list-timezones时显示America/Los_Angeles,为什么Docker也会抛出未知时区America/Los_Angeles 错误? The time zone database needed by LoadLocation may not be present on all systems, especially non-Unix systems. LoadLocation looks in the directory or uncompressed zip file named by the ZONEINFO environment variable, if any, then looks in known installation locations on Unix systems, and finally looks in $GOROOT/lib/time/zoneinfo.zip.
当LoadLocation在容器内运行或在容器文件中添加任何内容以使其指向zoneinfo时,还需要做其他事情吗?
来自godoc
最佳答案
对于任何寻求答案的人,这对我都有帮助。
将这两行添加到docker file中,(如果是两阶段构建,则最终结束)
ADD https://github.com/golang/go/raw/master/lib/time/zoneinfo.zip /zoneinfo.zip
ENV ZONEINFO /zoneinfo.zip
关于docker - 错误未知时区America/Los_Angeles在时间。,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59094236/