From a1d8d0bbcb5a17f878573a154024a71c009a4fb9 Mon Sep 17 00:00:00 2001 From: Jeff Wong Date: Tue, 15 Oct 2024 15:19:13 +0900 Subject: [PATCH] DEV: generate only en_us locales (#855) install locales-all installs 245MB Generating common and en_us locales installs 22MB update locales for postgres templates `locale-gen $LANG` doesn't seem to actually do anything without updates to `/etc/locale.gen`. Update the scripts to uncomment $LANG before running `update-locale`. --- image/base/Dockerfile | 5 +++-- templates/postgres.13.template.yml | 3 ++- templates/postgres.15.template.yml | 3 ++- templates/postgres.template.yml | 3 ++- 4 files changed, 9 insertions(+), 5 deletions(-) diff --git a/image/base/Dockerfile b/image/base/Dockerfile index e748249..2624f0a 100644 --- a/image/base/Dockerfile +++ b/image/base/Dockerfile @@ -29,10 +29,12 @@ RUN sh -c "fping proxy && echo 'Acquire { Retries \"0\"; HTTP { Proxy \"http://p RUN apt-mark hold initscripts RUN apt-get -y upgrade -RUN DEBIAN_FRONTEND=noninteractive apt-get install -y locales locales-all +RUN DEBIAN_FRONTEND=noninteractive apt-get install -y locales ENV LC_ALL en_US.UTF-8 ENV LANG en_US.UTF-8 ENV LANGUAGE en_US.UTF-8 +RUN sed -i "s/^# $LANG/$LANG/" /etc/locale.gen; \ + locale-gen RUN install -d /usr/share/postgresql-common/pgdg &&\ curl -o /usr/share/postgresql-common/pgdg/apt.postgresql.org.asc --fail https://www.postgresql.org/media/keys/ACCC4CF8.asc &&\ @@ -66,7 +68,6 @@ RUN cd / &&\ mkdir -p /etc/runit/1.d &&\ apt-get clean &&\ rm -f /etc/apt/apt.conf.d/40proxy &&\ - locale-gen en_US &&\ DEBIAN_FRONTEND=noninteractive apt-get install -y nodejs yarn &&\ npm install -g terser uglify-js pnpm diff --git a/templates/postgres.13.template.yml b/templates/postgres.13.template.yml index bb2c0a2..c5d0814 100644 --- a/templates/postgres.13.template.yml +++ b/templates/postgres.13.template.yml @@ -17,7 +17,8 @@ hooks: to: sv start postgres || exit 1 run: - - exec: locale-gen $LANG && update-locale + - exec: sed -i "s/^# $LANG/$LANG/" /etc/locale.gen + - exec: locale-gen && update-locale - exec: mkdir -p /shared/postgres_run - exec: chown postgres:postgres /shared/postgres_run - exec: chmod 775 /shared/postgres_run diff --git a/templates/postgres.15.template.yml b/templates/postgres.15.template.yml index e085800..548c575 100644 --- a/templates/postgres.15.template.yml +++ b/templates/postgres.15.template.yml @@ -52,7 +52,8 @@ run: chmod: "+x" contents: | #!/bin/bash - locale-gen $LANG && update-locale + sed -i "s/^# $LANG/$LANG/" /etc/locale.gen + locale-gen && update-locale mkdir -p /shared/postgres_run chown postgres:postgres /shared/postgres_run chmod 775 /shared/postgres_run diff --git a/templates/postgres.template.yml b/templates/postgres.template.yml index d46c6cb..95001a0 100644 --- a/templates/postgres.template.yml +++ b/templates/postgres.template.yml @@ -50,7 +50,8 @@ run: chmod: "+x" contents: | #!/bin/bash - locale-gen $LANG && update-locale + sed -i "s/^# $LANG/$LANG/" /etc/locale.gen + locale-gen && update-locale mkdir -p /shared/postgres_run chown postgres:postgres /shared/postgres_run chmod 775 /shared/postgres_run -- 2.25.1