Use “man pages” in Ubuntu docker containers

Kazushi Kitaya
1 min readAug 28, 2019

--

It is important to keep docker image sizes small for less disk space and shorter push & pull time. Therefore, there are many things that Ubuntu has but Ubuntu docker images do not contain. One such example is the “man pages.” The absence of them can be checked as follows.

$ docker run -it ubuntu:18.04
root@[...]:/# man read
bash: man: command not found

To bring them back, we can use the “unminimize” command.

$ unminimize
This system has been minimized by removing packages and content that are
not required on a system that users do not log into.

This script restores content and packages that are found on a default
Ubuntu server system in order to make this system more suitable for
interactive use.

Reinstallation of packages may fail due to changes to the system
configuration, the presence of third-party packages, or for other
reasons.

This operation may take some time.
Would you like to continue? [y/N]

Once it is done, you can open the man pages as usual.

Of course, the image gets much larger. Ubuntu images are about 100MB in size, but the image which can be built with the following Dockerfile is about 400MB in size.

FROM ubuntu:18.04
RUN apt-get update && yes | unminimize

--

--