Skip to content

alpine variant missing /usr/share/zoneinfo #220

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
ptman opened this issue Nov 15, 2016 · 9 comments
Closed

alpine variant missing /usr/share/zoneinfo #220

ptman opened this issue Nov 15, 2016 · 9 comments

Comments

@ptman
Copy link

ptman commented Nov 15, 2016

LOG:  could not open directory "/usr/share/zoneinfo": No such file or directory

which results in:

SELECT * FROM pg_timezone_names;
ERROR:  could not open directory "/usr/share/zoneinfo": No such file or directory

which can be fixed with

apk add tzdata
@ptman
Copy link
Author

ptman commented Nov 15, 2016

#221

@tianon
Copy link
Member

tianon commented Nov 15, 2016

This was actually excluded intentionally (

# tzdata loading functionality is optional, and fails gracefully
# tzdata \
):

# tzdata loading functionality is optional, and fails gracefully
#       tzdata \

Once it's added, it cannot be removed again (for users who don't need it), and it does add ~1.288 MB to the image size.

Something like the following should work to add it after the fact (which will then be imported during docker-entrypoint.sh and available at runtime):

FROM postgres:9.6-alpine

RUN apk add --no-cache tzdata

@ptman
Copy link
Author

ptman commented Nov 17, 2016

Thanks for the explanation.

@lockie
Copy link
Contributor

lockie commented Nov 19, 2016

For anyone interested: there's an unofficial repo of postgres in alpine with tzdata enabled out of the box.

@tianon
Copy link
Member

tianon commented Nov 19, 2016

Is the timezone data used commonly enough that we should reconsider including it by default?

Another really simple solution would be to mount in zoneinfo from the host, ie -v /usr/share/zoneinfo:/usr/share/zoneinfo:ro

@lockie
Copy link
Contributor

lockie commented Nov 20, 2016

Is the timezone data used commonly enough

It sorta is. The Django documentation suggests that timezone should be set for Postgre for performance reasons.

@ptman
Copy link
Author

ptman commented Nov 20, 2016

It seems to add 1.288 MB to the image

@lockie
Copy link
Contributor

lockie commented Nov 20, 2016

@ptman it is around 1/50 of image size, which is not that terribly much.

@tianon
Copy link
Member

tianon commented Nov 22, 2016

Yeah, seems sane enough -- someone want to make a PR uncommenting the existing line and removing the comment it has? (probably adding a new one pointing to that Django documentation as a real-world example)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants