Skip to content

Commit

Permalink
chore(docker): Reduce build time by only including supported locales,…
Browse files Browse the repository at this point in the history
… not all
  • Loading branch information
alerque committed May 15, 2024
1 parent 74642ad commit 1dab2dc
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,20 @@ ARG DOCKER_HUB_CACHE=1

ARG RUNTIME_DEPS

# Enable system locales for everything we have localizations for so tools like
# `date` will output matching localized strings. By default Arch Docker images
# have almost all locale data stripped out. This also makes it easier to
# rebuild custom Docker images with extra languages supported.
RUN sed -i -e '/^NoExtract.*locale/d' /etc/pacman.conf

# Freshen all base system packages
RUN pacman --needed --noconfirm -Syuq && yes | pacman -Sccq

# Enable all supported system locales instead of nearly none so tooling like
# `date` can output localized strings. By default Arch Docker images have
# almost all locale data stripped out.
RUN sed -i -e '/^NoExtract.*locale/d' /etc/pacman.conf
RUN pacman --noconfirm -S glibc && yes | pacman -Sccq
RUN cp /usr/share/i18n/SUPPORTED /etc/locale.gen
# Rebuild locale database after having enabled localization, added our
# supported locales, and making sure glibc *at least* has been updated without
# blocking locale files.
RUN pacman --noconfirm -Sq glibc && yes | pacman -Sccq
RUN grep -E '^(en|tr)_' /usr/share/i18n/SUPPORTED > /etc/locale.gen
RUN locale-gen

# Install run-time dependecies
Expand Down

0 comments on commit 1dab2dc

Please sign in to comment.