Skip to content

Commit a1d8d0b

Browse files
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`.
1 parent 20e33fb commit a1d8d0b

File tree

4 files changed

+9
-5
lines changed

4 files changed

+9
-5
lines changed

image/base/Dockerfile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,12 @@ RUN sh -c "fping proxy && echo 'Acquire { Retries \"0\"; HTTP { Proxy \"http://p
2929
RUN apt-mark hold initscripts
3030
RUN apt-get -y upgrade
3131

32-
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y locales locales-all
32+
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y locales
3333
ENV LC_ALL en_US.UTF-8
3434
ENV LANG en_US.UTF-8
3535
ENV LANGUAGE en_US.UTF-8
36+
RUN sed -i "s/^# $LANG/$LANG/" /etc/locale.gen; \
37+
locale-gen
3638

3739
RUN install -d /usr/share/postgresql-common/pgdg &&\
3840
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 / &&\
6668
mkdir -p /etc/runit/1.d &&\
6769
apt-get clean &&\
6870
rm -f /etc/apt/apt.conf.d/40proxy &&\
69-
locale-gen en_US &&\
7071
DEBIAN_FRONTEND=noninteractive apt-get install -y nodejs yarn &&\
7172
npm install -g terser uglify-js pnpm
7273

templates/postgres.13.template.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ hooks:
1717
to: sv start postgres || exit 1
1818

1919
run:
20-
- exec: locale-gen $LANG && update-locale
20+
- exec: sed -i "s/^# $LANG/$LANG/" /etc/locale.gen
21+
- exec: locale-gen && update-locale
2122
- exec: mkdir -p /shared/postgres_run
2223
- exec: chown postgres:postgres /shared/postgres_run
2324
- exec: chmod 775 /shared/postgres_run

templates/postgres.15.template.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,8 @@ run:
5252
chmod: "+x"
5353
contents: |
5454
#!/bin/bash
55-
locale-gen $LANG && update-locale
55+
sed -i "s/^# $LANG/$LANG/" /etc/locale.gen
56+
locale-gen && update-locale
5657
mkdir -p /shared/postgres_run
5758
chown postgres:postgres /shared/postgres_run
5859
chmod 775 /shared/postgres_run

templates/postgres.template.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,8 @@ run:
5050
chmod: "+x"
5151
contents: |
5252
#!/bin/bash
53-
locale-gen $LANG && update-locale
53+
sed -i "s/^# $LANG/$LANG/" /etc/locale.gen
54+
locale-gen && update-locale
5455
mkdir -p /shared/postgres_run
5556
chown postgres:postgres /shared/postgres_run
5657
chmod 775 /shared/postgres_run

0 commit comments

Comments
 (0)