-
Notifications
You must be signed in to change notification settings - Fork 740
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DEV: generate only en_us locales #855
Conversation
30fec38
to
337728b
Compare
Also other observation: passing |
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`.
19151eb
to
6a18035
Compare
@tgxworld let's start here with this for image size reduction. See the above comment for why I think we decided to originally pull locale-all. |
image/base/Dockerfile
Outdated
ENV LC_ALL en_US.UTF-8 | ||
ENV LANG en_US.UTF-8 | ||
ENV LANGUAGE en_US.UTF-8 | ||
ADD locale.gen /etc/locale.gen |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we should maintain a giant list of locales since we need to keep what is uncommented in the list in-sync with the LC_ALL
, LANG
and LANGUAGE
ENVs. I think we should just do something like echo 'en_US.UTF-8 UTF-8' >> /etc/locale.gen
which is what the official postgres docker image do.
image/base/locale.gen
Outdated
# this file, you need to rerun locale-gen. | ||
|
||
|
||
C.UTF-8 UTF-8 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a reason we need to generate this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could probably remove this too
image/base/locale.gen
Outdated
en_US ISO-8859-1 | ||
en_US.ISO-8859-15 ISO-8859-15 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we need to generate these too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just reached for all en_US languages - they're tiny in comparison to some of the larger, lesser-used languages but I'm fine with removing these too.
@featheredtoast My own research into agrees with your observation as well. I don't actually think we need to install all the generated locales in the base image. |
Sweet, I've updated the PR to only add |
This prevents double entries for en_US if LANG remains en_US.UTF-8 if it's uncommented again via postgres template multiple entries probably aren't harmful, but I'd prefer the file to be clean.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's try this out 👍 When you merge, do try out the new image on a couple of clusters to catch any potential problems before we do a wider roll out by bumping launcher :)
Just so the compressed savings marker doesn't get lost, final image size reduction on amd64: |
Wondering if we really need all locales installed in the base image here.
Installing the pre-built locales-all package via apt takes 245MB
Generating just c and en_us locales takes 22MB
@xfalcox I know it's been a while since the move to debian, but do you remember if this is necessary? One guess I have is the original call to locale-gen was being called a few layers later, with no locale.gen configuration file -- I'm assuming locale-gen en_US used to work, but it doesn't appear to actually do anything in debian given debian's default
/etc/locale.gen
is empty