Your image probably has the nodocs
transaction flag set in the yum configuration (cf. /etc/yum.conf
).
You can remove it globally (or at the yum command line) before (re-)installing the packages you want the man pages for.
For example:
yum --setopt=tsflags='' reinstall shadow-utils
I think I would prefer sharing the Dockerfile. Obviously you need to specifiy a version in the FROM
statement in your Dockerfile. Since for example different Ubuntu versions will have different packages available.
For system or -dev dependencies, you might want to actually let the version float freely to always installed the latest one.
Debian/Ubuntu packages
For any program installed with apt-get
, for example curl
, you can get the version number with
apt-cache policy curl | grep -oP 'Installed: \K\S+'
and then edit your Dockerfile to read something like
RUN apt-get install curl=7.47.0-1ubuntu2.2
Python
Python versions are easily handled with pip
. Extract all version numbers of installed packaged and store them in a requirements file like this:
pip freeze > requirements.txt
Then in your Dockerfile run
RUN pip install -r requirements.txt
Best Answer
ADD
performs a lot more “magic”: it fetches URLs and unpacks archives. That can be somewhat unexpected (especially the archive unpack). The official best practices guide recommends you use COPY unless you need ADD's extra features.