ubuntu 20.04套餐丢失了码头图像中的所有mo files

发布于 2025-01-22 12:04:44 字数 1563 浏览 3 评论 0原文

由于某种原因,ISO-编码软件包不会在Docker Image中安装其文件。

这是考虑到或多或少的最小码头框的考虑:

FROM ubuntu:20.04
ENV TZ=Etc/UTC
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get upgrade -y && apt-get install -y locales
RUN sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen && \
    dpkg-reconfigure --frontend=noninteractive locales && \
    update-locale LANG=en_US.UTF-8
ENV LANG en_US.UTF-8
ENV LC_ALL=en_US.UTF-8
RUN apt-get update && apt-get install -y iso-codes
RUN ls /usr

如果这些设置相关,我已经离开了与语言环境相关的设置。当我从和运行apt-get update& amp;&&时,出现同样的问题。 apt-get install -y iso-codes out。

建筑物:

docker build -t 'mytry:1' .

现在运行以下内容时,我在Mo -Files应该居住的目录中看不到任何内容:

docker run --cidfile /tmp/docker_test.cid 'mytry:1' ls -R /usr/share/locale/en/LC_MESSAGES/

但是,dpkg -l <​​/code>显示它在那里:

ii  iso-codes               4.4-1                        all          ISO language, territory, currency, script codes and their translations

dpkg -l <​​/code >目录中有一些文件:

/usr/share/locale/en/LC_MESSAGES
/usr/share/locale/en/LC_MESSAGES/iso_3166-2.mo
/usr/share/locale/en/LC_MESSAGES/iso_3166_2.mo

我缺少什么? 使用特定的docker运行方式。

(我正在 此类文件在任何地方。

同样,似乎也应该有MO文件的Poedit-Common缺少它们,因此问题更为笼统。

Docker -V给出

Docker version 20.10.7, build 20.10.7-0ubuntu5~20.04.2

For some reason, iso-codes package does not install it's files inside docker image.

Here is what as consider more or less minimal Dockerfile:

FROM ubuntu:20.04
ENV TZ=Etc/UTC
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get upgrade -y && apt-get install -y locales
RUN sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen && \
    dpkg-reconfigure --frontend=noninteractive locales && \
    update-locale LANG=en_US.UTF-8
ENV LANG en_US.UTF-8
ENV LC_ALL=en_US.UTF-8
RUN apt-get update && apt-get install -y iso-codes
RUN ls /usr

I have left locale-related settings in case those are relevant. The same problem appears when I comment all but FROM and RUN apt-get update && apt-get install -y iso-codes out.

Building:

docker build -t 'mytry:1' .

Now when I run the following, I do not see anything in the directory where mo-files should reside:

docker run --cidfile /tmp/docker_test.cid 'mytry:1' ls -R /usr/share/locale/en/LC_MESSAGES/

However, dpkg -l shows it's there:

ii  iso-codes               4.4-1                        all          ISO language, territory, currency, script codes and their translations

And dpkg -L has some files in the directory:

/usr/share/locale/en/LC_MESSAGES
/usr/share/locale/en/LC_MESSAGES/iso_3166-2.mo
/usr/share/locale/en/LC_MESSAGES/iso_3166_2.mo

What is that I am missing? (I am using the specific docker run way just for simplicity. The same problem arises in the normal usage)

I also tried find / -name 'iso_3166-1.mo', but seems like there is no such file anywhere.

Also it seems like poedit-common, which also should have mo files, is missing them, so the problem is more general.

docker -v gives

Docker version 20.10.7, build 20.10.7-0ubuntu5~20.04.2

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

负佳期 2025-01-29 12:04:44

我们找到了一个原因:

cat /etc/dpkg/dpkg.cfg.d/excludes
# Drop all man pages
path-exclude=/usr/share/man/*

# Drop all translations
path-exclude=/usr/share/locale/*/LC_MESSAGES/*.mo

# Drop all documentation ...
path-exclude=/usr/share/doc/*

# ... except copyright files ...
path-include=/usr/share/doc/*/copyright

# ... and Debian changelogs
path-include=/usr/share/doc/*/changelog.Debian.*

为了获取语言环境,应该评论path-exclude/usr/usr/share/share/locale/... >或替换文件。安装软件包之前。

当然,图像的大小会因此而增长。

We have found the reason:

cat /etc/dpkg/dpkg.cfg.d/excludes
# Drop all man pages
path-exclude=/usr/share/man/*

# Drop all translations
path-exclude=/usr/share/locale/*/LC_MESSAGES/*.mo

# Drop all documentation ...
path-exclude=/usr/share/doc/*

# ... except copyright files ...
path-include=/usr/share/doc/*/copyright

# ... and Debian changelogs
path-include=/usr/share/doc/*/changelog.Debian.*

In order to get locales, one should comment out the path-exclude line for /usr/share/locale/... or replace the file. Before installing packages.

Of course, the size of the image can grow as a result.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文