问题
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