ubuntu - docker ubuntu/bin/sh : 1: locale-gen: not found

标签 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

有什么想法吗?

最佳答案

感谢 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

关于ubuntu - docker ubuntu/bin/sh : 1: locale-gen: not found,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39760663/

相关文章:

mysql - 带有 mysql phpmyamdin 的 Syslog-NG 不能实时存储数据?

database - 在 Ubuntu 18.04 bionic 上安装 Adminer

docker - 在 Dockerfile 中运行与手动运行时存在不同的问题。出了什么问题?

linux - 如何在切片的 "screen"终端中上下滚动

linux - 如何防止禁用的 AD 用户登录拥有其公钥的 Linux 服务器?

Docker 组成 : expected a mapping or list of mappings for merging, 但发现标量

docker - 如何在 docker-compose healthchecks 上使用环境变量?

postgresql - 在docker环境下为tcp md5配置Postgres

docker - 如何运行 sleep 命令到 distroless

linux - 无法从 Ubuntu SSH 进入有线 SoC