Skip to content

Commit

Permalink
DEV: generate only en_us locales (discourse#855)
Browse files Browse the repository at this point in the history
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`.
  • Loading branch information
featheredtoast authored Oct 15, 2024
1 parent 20e33fb commit a1d8d0b
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 deletions.
5 changes: 3 additions & 2 deletions image/base/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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 &&\
Expand Down Expand Up @@ -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

Expand Down
3 changes: 2 additions & 1 deletion templates/postgres.13.template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion templates/postgres.15.template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion templates/postgres.template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit a1d8d0b

Please sign in to comment.