我使用以下Dockerfile构建镜像并启动容器。但是一旦进入容器,我仍然找不到手册页。有人知道如何解决这个问题吗?

$ cat Dockerfile
FROM ubuntu
RUN apt -y update && apt -y upgrade
RUN apt-get -y install build-essential
RUN apt-get -y install vim
RUN apt-get -y install man
RUN apt-get -y install gawk
RUN apt-get -y install mawk

$ man man
No manual entry for man
See 'man 7 undocumented' for help when manual pages are not available.
$ find /usr/share/man /usr/local/share/man  -type f

最佳答案

您需要在容器中更改/etc/dpkg/dpkg.cfg.d/excludes。您可以使用以下命令在Dockerfile中执行此操作:

RUN sed -i 's:^path-exclude=/usr/share/man:#path-exclude=/usr/share/man:' \
        /etc/dpkg/dpkg.cfg.d/excludes

然后对您的Dockerfile进行另一次更新以安装手册页

RUN apt-get update && \
    apt-get install -y \
        man \
        manpages-posix

关于docker - 如何在Ubuntu Docker镜像上安装手册页?,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/54152906/

10-13 09:36