docker ubuntu / bin / sh:1:locale-gen:未找到

时间:2016-09-29 02:56:09

标签: ubuntu docker

我将下面的语言环境设置代码放入我的dockerfile,

FROM node:4-onbuild

# Set the locale
RUN locale-gen en_US.UTF-8
ENV LANG en_US.UTF-8
ENV LANGUAGE en_US:en
ENV LC_ALL en_US.UTF-8

但它给了我错误

/bin/sh: 1: locale-gen: not found
The command '/bin/sh -c locale-gen en_US.UTF-8' returned a non-zero code: 127

任何想法?

2 个答案:

答案 0 :(得分:136)

感谢your comment, edwinksl。我更新了我的dockerfile,解决了locale-gen错误:

FROM node:4-onbuild

# Set the locale
RUN apt-get clean && apt-get update && apt-get install -y locales
RUN locale-gen en_US.UTF-8

答案 1 :(得分:0)

apt-get install -y locales
localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8

localedef也很好用。