Open Enchufa2 opened 5 years ago
yum install -y glibc-langpack-en
I know, but having to do that it's kind of annoying. Language settings should be properly configured by default (by setting C.UTF-8 or by having that package installed by default; I'd prefer the first option, as fedora and centos:7 do).
I think as Enchufa2 - it should default better. In CentOS 7 default locale was set to POSIX and all was fine, no error messages all over the place.
there are some Docker images based on CentOS (like jenkins/jenkins:centos) can not display file path correctly even added the --env LANG=en_US.UTF-8
running parameter.
You can use these commands to set it up . yum install -y glibc-locale-source localedef --no-archive -i en_US -f UTF-8 en_US.UTF-8 export LANG=en_US.UTF-8
Noticed this the other day, glad I wasn't the only person that thought it was odd.
I agree with @Enchufa2 , the locale should default to something that is deployed inside the image by default (e.g. 'C.utf8' or just 'POSIX').
Still exists in the 8.3 release
Looks like the official RH UBI8 images use only POSIX
and C.utf8
$ podman run --rm registry.access.redhat.com/ubi8/ubi-minimal:8.4 /bin/bash -c locale | grep NAME
LC_NAME="POSIX"
$ podman run --rm registry.access.redhat.com/ubi8/ubi-minimal:8.4 /bin/bash -lc locale | grep NAME
LC_NAME="C.utf8"
In the current image, the locale is configured as en_US.UTF-8, presumably via this file:
# cat /etc/locale.conf
LANG="en_US.UTF-8"
I think this file should be dropped, and the locale such be set from the container file instead, so that it can be changed easily from the outside. As far as I can tell podman run
does not implement locale forwarding (unlike SSH in CentOS), so this change should be sufficient to address the issue.
Still exists in the newly posted 8.4 images (thanks for upgrading, btw):
$ podman run --rm docker.io/centos:8 cat /etc/redhat-release
CentOS Linux release 8.4.2105
$ podman run --rm docker.io/centos:8 cat /etc/locale.conf
LANG="en_US.UTF-8"
$ podman run --rm docker.io/centos:8 /bin/bash -c locale | grep NAME
LC_NAME="POSIX"
$ podman run --rm docker.io/centos:8 /bin/bash -lc locale | grep NAME
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
LC_NAME="en_US.UTF-8"
Would this fix (upstream) be as simple as changing this line from lang en_US
to lang C.utf8
?
There's more locale setup further below. It seems that a later step (that is not reflected in the kickstart file) removes en_US.UTF-8
from the image. Maybe that should be removed and the installation changed to use C.UTF-8
.
There's more locale setup further below. It seems that a later step (that is not reflected in the kickstart file) removes
en_US.UTF-8
from the image. Maybe that should be removed and the installation changed to useC.UTF-8
.
Bet that will do the trick, was going to test and hopefully get in a merge request, but ran into an unexpected Not enough free space on selected disks
per Issue 176 when trying to build the stock image (on a system with plenty of free HDD space).
Given CentOS 8 is dead, long live CentOS Stream 8, the latter's container appears to not have the locale issue, guessing this issue is now OBE?
$ podman run --rm centos:stream8 cat /etc/redhat-release
CentOS Stream release 8
$ podman run --rm centos:stream8 cat /etc/locale.conf
LANG=C.utf8
$ podman run --rm centos:stream8 /bin/bash -c locale | grep NAME
LC_NAME="POSIX"
$ podman run --rm centos:stream8 /bin/bash -lc locale | grep NAME
LC_NAME="C.utf8"
Related to #71 and #58. Steps to reproduce:
but
I think that the locale should be set to C.UTF-8 by default, as it is in Fedora.