Closed gaslitbytech closed 9 months ago
Same issue with postgres: latest
, which currently points to 15.3-bookworm
according to the README here: https://hub.docker.com/_/postgres/
Looks to be related to a package upgrade
postgres:14 image doesn't work if you run apt upgrade
logs :
2023-07-24 18:03:57 2023-07-24 16:03:57.531 UTC [1] LOG: invalid value for parameter "lc_messages": "en_US.utf8"
2023-07-24 18:03:57 2023-07-24 16:03:57.531 UTC [1] LOG: invalid value for parameter "lc_monetary": "en_US.utf8"
2023-07-24 18:03:57 2023-07-24 16:03:57.531 UTC [1] LOG: invalid value for parameter "lc_numeric": "en_US.utf8"
2023-07-24 18:03:57 2023-07-24 16:03:57.531 UTC [1] LOG: invalid value for parameter "lc_time": "en_US.utf8"
Unfortunately, these images aren't designed for handling package upgrades (in other words, that's not an intentionally supported use case). :grimacing:
Unfortunately, these images aren't designed for handling package upgrades (in other words, that's not an intentionally supported use case). 😬
@tianon It appears the root cause here is the direct use of localedef
in the images (e.g. here: https://github.com/docker-library/postgres/blob/master/13/bookworm/Dockerfile#L58), which will later get removed by a locale-gen
, such as is issued when the locales
package is upgraded (which unfortunately can happen even when installing unrelated packages).
This makes building off of these packages challenging, see e.g. https://github.com/pgvector/pgvector/issues/197 which was worked around by the author by using apt-mark hold locales
before calling apt-get
(https://github.com/pgvector/pgvector/commit/237a6df51f45f1de4eff077ab030ad559eae4a38).
Is there a reason the images don't use the locale-gen
infrastructure, which appears to be the official way to do this? (https://wiki.debian.org/Locale#Manually)
If the corresponding lines that currently call locale-def
were instead using locale-gen
, this would be fixed, I imagine. i.e.
- localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8
+ echo en_US.UTF-8 UTF-8 >> /etc/locale.gen && locale-gen
If you agree this is a feasible approach, happy to make a PR.
Hmm yeah, I guess we should use locale-gen
:disappointed:
I don't love just blindly appending to that locale.gen
file (what if the format changes in the future?), but I suppose it's probably OK (and better than where we are today)
Hmm yeah, I guess we should use
locale-gen
😞
See https://github.com/docker-library/postgres/pull/1159 - I've tested that with a modified pgvector Dockerfile (that doesn't hold the locales package, and does an explicit locale-gen
to imitate a locales
package update) and confirmed it works as expected.
Currently getting the following errors as of today.
I've stumbled on 2 potential solutions that seems to fix it:
be explicit and use
13.11-bullseye
tag instead of just13.11
. Orto add the following locale sttings to our Dockerfile with
13.11-bookworm
I just don't get why we would need to do this now as all 13.11, 13.11-bullseye and 13.11-bookworm was last pushed 19 days ago. And would find it hard to justify either of these workarounds.
This is on both on my Ubuntu workstation and CI that are both using docker
24.0.4
and buildxv0.11.1