将具有俄语名称的文件复制到容器中

问题描述 投票:0回答:1

我在 wwwroot 中有带有俄语文件名的 asp.net core mvc 应用程序。复制到 docker 容器时,名称无法正确显示。 enter image description here 然后在 dotnet 发布阶段出现错误

"error MSB3030: Could not copy the file "/src/src/VL_APP.Web.Mvc/wwwroot/**" because it was not found."

发生。据我怀疑这是由于容器中文件的路径不正确。

解决方案可能是将文件重命名为英文并更改代码库以使用重命名的文件。这可行,但我对此解决方案不满意,我需要俄语文件名。

尝试在 Dockerfile 中进行本地化操作未成功。

RUN apt-get install -y locales
RUN locale-gen en_US.UTF-8

有没有办法通过容器本地化或者其他方式来解决这个问题?

c# asp.net-mvc docker asp.net-core localization
1个回答
0
投票

这有效:

RUN apt-get update && apt-get install -y locales && rm -rf /var/cache/apt/archives
RUN locale-gen en_US.UTF-8
ENV LANG=en_US.UTF-8

使用

ubuntu:latest
进行测试。请注意,默认使用
alpine:latest
俄语文件名。

© www.soinside.com 2019 - 2024. All rights reserved.