Skip to content

Missing en_US.utf8 locale in -minimal images #205

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

Open
NiccoloFei opened this issue May 23, 2025 · 1 comment
Open

Missing en_US.utf8 locale in -minimal images #205

NiccoloFei opened this issue May 23, 2025 · 1 comment
Labels
bug Something isn't working

Comments

@NiccoloFei
Copy link
Contributor

The new -minimal images are lacking the en_US.utf8 locale in comparison to the system images.
This happens because in the -minimal images we are lacking the following step, which is instead being done in the base images that system images depend on.

Although -standard images are carrying all locales, I was expecting -minimal images to at least have the same amount of locales that we have in system images.

For reference:

$ docker run --rm -it ghcr.io/cloudnative-pg/postgresql:17-bookworm locale -a
C
C.utf8
en_US.utf8
POSIX

vs

$ docker run --rm -it ghcr.io/cloudnative-pg/postgresql:17-minimal-bookworm locale -a
C
C.utf8
POSIX
Copy link

dosubot bot commented May 23, 2025

The absence of the en_US.utf8 locale in the -minimal images is expected by design. The minimal images are built to be lightweight and do not include locales by default, whereas the -standard images explicitly install all locales (via the locales-all package), and the system images inherit locale setup from their base image. This is why you see en_US.utf8 in system and standard images, but not in minimal images reference.

If you want to add the en_US.utf8 locale to a -minimal image, you would need to modify the Dockerfile to install the necessary locale packages and generate the locale. For example, you could add the following steps to your Dockerfile after installing PostgreSQL:

RUN apt-get update && \
    apt-get install -y --no-install-recommends locales && \
    sed -i '/en_US.UTF-8/s/^# //g' /etc/locale.gen && \
    locale-gen && \
    rm -rf /var/lib/apt/lists/*

This will install the locales package, enable the en_US.UTF-8 locale, and generate it, making it available in the image.

The current minimal image intentionally omits this step to keep the image size small reference. If you need the locale, you can extend the minimal image as shown above or use the standard image, which already includes all locales.

To continue talking to Dosu, mention @dosu-bot.


Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Bug Report | Other

@dosubot dosubot bot added the bug Something isn't working label May 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant