Skip to content
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

localedef is missing #7

Closed
jgeiger opened this issue Jun 12, 2014 · 13 comments
Closed

localedef is missing #7

jgeiger opened this issue Jun 12, 2014 · 13 comments

Comments

@jgeiger
Copy link

jgeiger commented Jun 12, 2014

In the latest version of this image not root users get a bunch of issues with locales.

-bash: warning: setlocale: LC_CTYPE: cannot change locale (us): No such file or directory
-bash: warning: setlocale: LC_COLLATE: cannot change locale (us): No such file or directory
-bash: warning: setlocale: LC_MESSAGES: cannot change locale (us): No such file or directory
-bash: warning: setlocale: LC_NUMERIC: cannot change locale (us): No such file or directory
-bash: warning: setlocale: LC_TIME: cannot change locale (us): No such file or directory

When trying to fix it using localedef, it's not available.
localedef -c -f UTF-8 -i en_US en_US.UTF-8
fails because the command isn't installed.

You need to remove the package from the DB and then reinstall.
rpm -e glibc-common
yum install glibc-common

It would be nice if this were back in by default.

@ghost
Copy link

ghost commented Jun 12, 2014

It seems we stripped a bit too much out when making this image smaller. I'll work on resolving this for you in the next image.

@stpierre
Copy link
Contributor

It seems like a fairly rare use case to have users directly interacting with a Docker container as a shell, and even more so to need locales. I'd suggest keeping the base image as small as possible, and then people who need locales can easily reinstall glibc-common in their Dockerfile. E.g.:

FROM centos/centos6
RUN yum reinstall glibc-common
...

I'd vote in favor of keeping the image as minimal as possible, especially since this seems fairly easy to fix for those who need it.

@jgeiger
Copy link
Author

jgeiger commented Jun 13, 2014

If this is the build for the default CentOS docker container, it shouldn't make people jump through hoops. Seems silly to re-install an installed package just to get something that should be installed with the package in the first place.

@stpierre
Copy link
Contributor

Normally I'd agree with you, but Docker eats disk for breakfast, lunch, dinner, elevensies, and several snacks in between. Keeping this image tiny is super important, especially when it comes at the expense of a feature that's probably going to be used very rarely.

@ghost
Copy link

ghost commented Jun 16, 2014

So, perhaps there's a middle ground here. Do we know the specific files needed here? Perhaps if we alter the locale find to omit specific files we can have both a tiny image, and fix this issue. Maybe something like:

find /usr/{{lib,share}/{i18n,locale},{lib,lib64}/gconv,bin/localedef,sbin/build-locale-archive} -type f ( ! -iname "utf" ! -name "en_US" )

instead of the current find statement used?

@ghost
Copy link

ghost commented Jun 16, 2014

It'll have to be a middle ground fix. without cleaning these files up, the image is 273MB. Far larger than we'd like to see.

@chuckleb
Copy link

I feel that it would be nice to have two versions, a minimal that breaks most things but for those determined to get the smallest build could use it, and a functional version. Stripping it down too much will scare away people new to Docker but want to use CentOS. After you are used to it, you will want the minimal version.

@ghost
Copy link

ghost commented Jun 17, 2014

that could be considered. if you're subscribed to the centos-devel mailing list -> http://lists.centos.org/mailman/listinfo/centos-devel , you can bring that up, otherwise I'll bring it to the group tomorrow.

@arif-ali
Copy link
Contributor

So in my case we are using OpenVZ, and the loceldef stuff is required, and in-fact the size of the image doesn't matter as much for the docker image. I have modified the kickstart image and also created a script that creates an image from a chrooted environment https://gitlab.arif-ali.co.uk/centos/sig-cloud-instance-build/tree/master/openvz

With the docker image, I was getting the following issue

# vzctl enter 117
entered into CT 117
-bash: warning: setlocale: LC_CTYPE: cannot change locale (en_GB.UTF-8): No such file or directory
-bash: warning: setlocale: LC_COLLATE: cannot change locale (en_GB.UTF-8): No such file or directory
-bash: warning: setlocale: LC_MESSAGES: cannot change locale (en_GB.UTF-8): No such file or directory
-bash: warning: setlocale: LC_NUMERIC: cannot change locale (en_GB.UTF-8): No such file or directory
-bash: warning: setlocale: LC_TIME: cannot change locale (en_GB.UTF-8): No such file or directory
[root@localhost /]#

in-fact the kickstart provided with docker doesn't allow the hostname to change with the openvz configuration.

let me know your thoughts

@ghost
Copy link

ghost commented Jun 18, 2014

As we (the dev team) discussed via irc today, we'll likely create two images. One absolutely bare (as this one mostly is) and one unstripped. Still a very minimal install, but without files such as locale info removed.

@ghost
Copy link

ghost commented Jun 26, 2014

@jgeiger would you be willing to test and provide feedback on the images at http://people.centos.org/evolution/docker/

The -test image has had some modifications made to how we strip the image, so it should work. If it doesn't, the -unstripped image is available, but it's double the size (at 293MB).

@ghost
Copy link

ghost commented Jul 20, 2014

I've changed up how this is done, so that it keeps some languages and deletes others. I'll have some new images to test a bit later.

@jdeathe
Copy link

jdeathe commented Jul 11, 2016

The warning messages reported here can be prevented by removing the settings from /etc/sysconfig/i18n with either:

/usr/bin/truncate -s 0 /etc/sysconfig/i18n

OR

:> /etc/sysconfig/i18n

@jgeiger jgeiger closed this as completed Nov 10, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants