기반으로 도커 이미지를 작성 중이며 Ubuntu 14.04
로케일을 올바르게 설정하는 데 문제가 있습니다.
(14.04가 EOL이라는 것을 알고 있지만 여전히 작동해야합니다. 그렇죠? askubuntu.com에서 Ubuntu 사람들의 지원을 거부 당했기 때문에 여기에서 운을 시험하고 있습니다)
내 Dockerfile
모습 :
COPY .bashrc /root/.bashrc
RUN apt-get -y update
RUN apt-get -y upgrade
RUN apt-get install -y build-essential \
locales
RUN dpkg-reconfigure locales
WORKDIR /home/prs/
어디에 .bashrc
:
export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8
export LANGUAGE=en_US.UTF-8
오류없이 빌드 docker build -t "test" .
되지만 실행하면 다음 출력이 표시됩니다.
$ docker run -it test
bash: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8): No such file or directory
root@d09247a538eb:/# source /root/.bashrc
bash: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8)
root@d09247a538eb:/#
나는 또한 시도했다 :
echo "LANG=en_US.UTF-8" > /etc/locale.conf
나는 여전히 얻는다 :
# locale-gen
/bin/bash: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8)
이게 무슨 일이야? 로케일을 올바르게 설정하려면 어떻게해야합니까?
최신 정보:
컨테이너 이미지를에서 기본 Ubuntu 18.04
으로 locale
하면 입력 할 때 a를 선택하게 # dpkg-reconfigure locales
되지만 14.04
(현재 필요한 것임) 다음과 같은 결과가 나타납니다.
# dpkg-reconfigure locales
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = "en_US.UTF-8",
LC_ALL = "en_US.UTF-8",
LANG = "en_US.UTF-8"
are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
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
/bin/bash: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8)
Eduardo Trápani (@ EduardoTrápani)가 아래에 제안한대로 로케일 설정을 수동으로 실행하려고했습니다.
# echo "en_US.UTF-8 UTF-8" | sudo tee -a /etc/locale.gen
en_US.UTF-8 UTF-8
# locale-gen
/bin/bash: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8)
또 다른 힌트는 locales / sup [ported.d 디렉토리에 아무것도 없다는 locale-gen
것입니다 (http://manpages.ubuntu.com/manpages/precise/man8/locale-에서 올바르게 이해 하면 결과가되어야 합니다). gen.8.html) :
# ls -l /var/lib/locales/supported.d/
총 0
로케일을에 추가하고 /etc/locale.gen
빌드 한 다음 사용할 수 있습니다.
$ sudo echo "en_US.UTF-8 UTF-8" | sudo tee -a /etc/locale.gen
$ sudo locale-gen
이러한 명령을 docker 파일에 넣을 수 있습니다.
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다