无法在Docker映像中配置语言环境 [英] Can't configure locale in Docker image

查看:120
本文介绍了无法在Docker映像中配置语言环境的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在Docker映像中安装语言环境文件,但由于某种原因,该文件无法正确安装。

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

这些在我的<$ c中的行$ c> Dockerfile 进行配置并安装语言环境文件:

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

图像创建成功。当我运行 docker exec ** ID ** locale -a 时,仍然出现以下错误:

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?

推荐答案

尝试同时使用语言环境 locales-all

like:

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

这篇关于无法在Docker映像中配置语言环境的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆