graalvm / container

GraalVM container images
Other
166 stars 37 forks source link

Missing locales in ol8 image #9

Closed jam13 closed 3 years ago

jam13 commented 3 years ago
bash-4.4# 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"

Which results (I think) in the wrong locale being used in Java.

Fixed with:

bash-4.4# microdnf install glibc-langpack-en
...
bash-4.4# locale
LANG=en_US.UTF-8
LC_CTYPE="en_US.UTF-8"
AlexWayfer commented 3 years ago

I confirm: even gem install bundler doesn't work on TruffleRuby Docker image:

gem install bundler
ERROR:  Error installing bundler:
    invalid gem: package is corrupt, exception while verifying: invalid byte sequence in US-ASCII (ArgumentError) in /opt/truffleruby-21.1.0-linux-amd64/lib/gems/cache/bundler-2.2.16.gem

Work-around works, thank you @jam13.

eregon commented 3 years ago

It seems LANG is set correctly but the locale files do not exist:

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=
bash-4.4# 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
C.utf8
POSIX

Also filed as https://github.com/oracle/truffleruby/issues/2350

abdelhaira commented 3 years ago

Thank you for submitting this issue, this have been fixed here

o-nix commented 1 year ago

I am using FROM ghcr.io/graalvm/graalvm-community:17 (which is ol9), and the encoding is broken unless I explicitly add RUN microdnf install -y glibc-langpack-en in my Dockerfile.