I have a Go application that I build into a binary and distribute as a Docker image.
Currently, I'm using ubuntu as my base image, but this causes an issue where if a user tries to use a Timezone other than UTC or their local timezone, they get an error stating:
pod error: panic: open /usr/local/go/lib/time/zoneinfo.zip: no such file or directory
This error is caused because the LoadLocation package in Go requires that file.
I can think of two ways to fix this issue:
Continue using the
ubuntubase image, but in my Dockerfile add the commands:RUN apt-get install -y tzdataUse one of Golang's base images, eg.
golang:1.7.5-alpine.
What would be the recommended way? I'm not sure if I need to or should be using a Golang image since this is the container where the pre-built binary runs. My understanding is that Golang images are good for building the binary in the first place.
tzdatapackage, then you need to install that. What image are you building your binary with?golang:1.7.5-alpinecontainertzdatapackage in myubuntucontainer, or use one ofgolangcontainers.