Can't configure locale in Docker image

前提是你 提交于 2020-06-16 07:27:24

问题


I'm trying to install a locale file in my Docker image, but for some reason it doesn't install correctly.

These lines inside my Dockerfile do configure + install the locale files:

# Install and configure locales
RUN ["apt-get", "install", "-y", "locales"]
RUN ["locale-gen", "nl_NL.UTF-8"]
RUN ["dpkg-reconfigure", "locales"]
RUN ["update-locale"]
ENV LANG nl_NL.UTF-8

The image is created succesfully. When I run docker exec **ID** locale -a I still get the following error:

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.UTF-8
POSIX

So I guess it didn't installed the locale files correctly. Anyone could help me with this?


回答1:


Try both locales and locales-all

like :

RUN apt-get update && apt-get install -y --no-install-recommends \
    locales \
    locales-all \


来源:https://stackoverflow.com/questions/32333650/cant-configure-locale-in-docker-image

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!