Skip to content

Instantly share code, notes, and snippets.

@shyd
Last active February 12, 2026 10:47
Show Gist options
  • Select an option

  • Save shyd/ce8ba7e20d4f825ed3a8e57aa30b892b to your computer and use it in GitHub Desktop.

Select an option

Save shyd/ce8ba7e20d4f825ed3a8e57aa30b892b to your computer and use it in GitHub Desktop.
install locales inside a docker image
FROM debian
RUN apt-get update && \
apt-get install -y \
locales && \
rm -r /var/lib/apt/lists/*
RUN sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen && \
sed -i -e 's/# de_DE.UTF-8 UTF-8/de_DE.UTF-8 UTF-8/' /etc/locale.gen && \
dpkg-reconfigure --frontend=noninteractive locales
@samir-plusb
Copy link

thanks!

@robertu
Copy link

robertu commented Dec 9, 2023

Works as expected! Thanks for sharing.

@fbrisa
Copy link

fbrisa commented Apr 21, 2025

thanks from me too, after one hour of struggling with docker

@maelgllt
Copy link

And how do I do that on an almalinux10-minimal image?

@shyd
Copy link
Author

shyd commented Feb 12, 2026

And how do I do that on an almalinux10-minimal image?

If you ask AI, this is the output:

# Use AlmaLinux 10 minimal as the base image
FROM almalinux:10-minimal

# Install the desired language pack
# 'dnf' is available in the minimal image to manage packages
RUN dnf install -y glibc-langpack-en && \
    dnf clean all

# Set environment variables to define the locale
ENV LANG=en_US.UTF-8
ENV LANGUAGE=en_US:en
ENV LC_ALL=en_US.UTF-8

# (Optional) Verify the locale setting
RUN locale

I do not use almalinux, please research on your own.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment