Skip to content

Commit

Permalink
feat(docker): Enable data for all provided tools that support system …
Browse files Browse the repository at this point in the history
…locales
  • Loading branch information
alerque committed May 30, 2024
1 parent 44ff649 commit c01203f
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,22 @@ FROM docker.io/library/archlinux:base-devel$ARCHTAG AS builder
ARG RUNTIME_DEPS
ARG BUILD_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-key --init
RUN pacman --needed --noconfirm -Syq archlinux-keyring
RUN pacman --needed --noconfirm -Suq

# Make sure *at least* glibc actually got reinstalled after enabling
# extraaction of locale files even if the version was fresh so we can use the
# locale support out of it later.
RUN pacman --noconfirm -Sq glibc && yes | pacman -Sccq

# Install run-time dependecies
RUN pacman --needed --noconfirm -Sq $RUNTIME_DEPS $BUILD_DEPS

Expand All @@ -21,6 +32,10 @@ ARG REVISION
COPY ./ /src
WORKDIR /src

# Rebuild locale database after having added our supported locales.
RUN ls i18n/ | sed 's/[.-].*$/_/;s/^/^/' | sort -u | grep -Ef - /usr/share/i18n/SUPPORTED > /etc/locale.gen
RUN locale-gen

# GitHub Actions builder stopped providing git history :(
# See feature request at https://github.com/actions/runner/issues/767
RUN build-aux/docker-bootstrap.sh
Expand All @@ -40,6 +55,9 @@ ARG RUNTIME_DEPS
ARG VERSION
ARG REVISION

# Set system locale to something other than 'C' that resolves to a real language
ENV LANG=en_US.UTF-8

# Freshen all base system packages (and cleanup cache)
RUN pacman-key --init
RUN pacman --needed --noconfirm -Syq archlinux-keyring && yes | pacman -Sccq
Expand Down

0 comments on commit c01203f

Please sign in to comment.