forked from joshmhanson/docker-env
-
Notifications
You must be signed in to change notification settings - Fork 0
Install man page
Da (Derek) Kuang edited this page May 17, 2021
·
3 revisions
The minimal Ubuntu diverts the /user/bin/man
to a fake binary file /usr/bin/man.REAL
. So if the Dockerfile, we check if the file is diverted then we remove the file.
RUN if [ "$(dpkg-divert --truename /usr/bin/man)" = "/usr/bin/man.REAL" ]; then \
rm -f /usr/bin/man; \
dpkg-divert --quiet --remove --rename /usr/bin/man; \
fi
Then use sed to comment out the exclude rule
RUN sed -i 's,^path-exclude=/usr/share/man/,#path-exclude=/usr/share/man/,' /etc/dpkg/dpkg.cfg.d/excludes
Then we can install the manpages in docker-setup.sh
.
apt-get install -y man man-db manpages-posix manpages-dev manpages-posix-dev
This page is mainly based on @hanjiexi's feedback on Piazza at 2021 Summer. Thank you for the great contribution.
- Discussion about the problem: https://github.com/docker/for-linux/issues/639
- Reference solution of the divertion: https://github.com/docker/docker-ce-packaging/blob/master/deb/ubuntu-focal/Dockerfile
- Reference solution of installing man page: https://stackoverflow.com/questions/54152906/how-to-install-man-pages-on-an-ubuntu-docker-image