我正在使用 Docker 映像并正在构建一个 dockerfile。该文件locale.gen
(来自)包含与语言一起的/etc/locale.gen
注释:#
ca_ES.UTF-8 UTF-8 # Catalan (Spain)
de_DE.UTF-8 UTF-8 # German (Germany)
el_GR.UTF-8 UTF-8 # Greek (Greece)
en_GB.UTF-8 UTF-8 # English (United Kingdom)
en_NZ.UTF-8 UTF-8 # English (New Zealand)
en_US.UTF-8 UTF-8 # English (United States)
eo UTF-8 # Esperanto
es_AR.UTF-8 UTF-8 # Spanish (Argentina)
es_ES.UTF-8 UTF-8 # Spanish (Spanish)
es_UY.UTF-8 UTF-8 # Spanish (Uruguay)
eu_ES.UTF-8 UTF-8 # Basque (Spain)
fr_FR.UTF-8 UTF-8 # French (France)
it_IT.UTF-8 UTF-8 # Italian (Italy)
ja_JP.UTF-8 UTF-8 # Japanese (Japan)
ka_GE.UTF-8 UTF-8 # Georgian (Georgia)
ko_KR.UTF-8 UTF-8 # Korean (Korea)
mi_NZ.UTF-8 UTF-8 # Maori (New Zealand)
nl_NL.UTF-8 UTF-8 # Dutch (Netherlands)
pt_BR.UTF-8 UTF-8 # Portuguese (Brazil)
pt_PT.UTF-8 UTF-8 # Portuguese (Portugal)
ro_RO.UTF-8 UTF-8 # Romanian (Romania)
ru_RU.UTF-8 UTF-8 # Russian (Russia)
uk_UA.UTF-8 UTF-8 # Ukranian (Ukraine)
xh_ZA.UTF-8 UTF-8 # Xhosa (South Africa)
zh_CN.UTF-8 UTF-8 # Chinese (China)
如果我运行简单的命令locale-gen
,它会因为注释而失败,这就是为什么我必须使用该选项awk -F "#" '{print $1}'
,但它仍然失败。
看看它在 dockerfile 中的样子:
#
答案1
我建议您考虑更改 Docker 文件以复制源文件,然后修改它:
#