Skip to content

Default locale is set to en_US.UTF-8 but it's missing #71

Closed
@robinst

Description

@robinst

We use the CentOS 7 image for testing, and have had an error related to locales that started happening only a few days ago. Steps to reproduce:

Using the following Dockerfile:

FROM centos:7
RUN yum -y install gcc libmemcached-devel

Build it:

$ docker build .

Run the build image:

$ docker run -ti ab7f114ea298
bash: warning: setlocale: LC_CTYPE: cannot change locale (en_US.UTF-8): No such file or directory
bash: warning: setlocale: LC_COLLATE: cannot change locale (en_US.UTF-8): No such file or directory
bash: warning: setlocale: LC_MESSAGES: cannot change locale (en_US.UTF-8): No such file or directory
bash: warning: setlocale: LC_NUMERIC: cannot change locale (en_US.UTF-8): No such file or directory
bash: warning: setlocale: LC_TIME: cannot change locale (en_US.UTF-8): No such file or directory
[root@476f2cc9c761 /]# locale  
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_MESSAGES to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory
LANG=en_US.UTF-8
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=
[root@476f2cc9c761 /]# locale -a
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_MESSAGES to default locale: No such file or directory
locale: Cannot set LC_COLLATE to default locale: No such file or directory
C
POSIX
[root@476f2cc9c761 /]# cat /etc/locale.conf
LANG="en_US.UTF-8"

We narrowed it down to the combination of the two packages gcc and libmemcached-devel. If just installing either one on its own, the problem doesn't occur. libmemcached-devel seems to pull in a package that creates /etc/profile.d/lang.sh which seems to be the thing setting the locale.

But somehow in that yum transaction, the locales seem to not be built properly, as you can see in the locale -a output above.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions