Option to skip man installation

Hello,

I’m looking for an option to skip man pages and documentation installation in formulae.

The idea is to use brew in Docker and keep images as small as possible.

Here is the files I’d like to remove :

$ du -sh /home/linuxbrew/.linuxbrew/Cellar/openssl\@1.1/1.1.1g/share/*
4.5M	/home/linuxbrew/.linuxbrew/Cellar/openssl@1.1/1.1.1g/share/doc
6.1M	/home/linuxbrew/.linuxbrew/Cellar/openssl@1.1/1.1.1g/share/man

$ du -sh /home/linuxbrew/.linuxbrew/share/man/*
336K	/home/linuxbrew/.linuxbrew/share/man/man1
16M	/home/linuxbrew/.linuxbrew/share/man/man3
12K	/home/linuxbrew/.linuxbrew/share/man/man5
52K	/home/linuxbrew/.linuxbrew/share/man/man7

Thanks for your help

There isn’t one, and I suspect such a separation isn’t likely to be entertained.

Instead, I’d suggest:

# Remove all documentation from all installed formulas
rm -fr $(brew --cellar)/*/*/share/{doc,man}
# And clean up any broken symlinks in the process
find $HOMEBREW_PREFIX/share/{doc,man} -xtype l -exec rm -fv {} +
2 Likes

You may also be interested in this post for tips on slimming Docker images:

2 Likes

Thanks for your help !

CI=true is also a good way to limit homebrew size (it saves 300mb) but I’m not sure about the impact for updates :

/bin/bash -c "export CI=true && $(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"

If /usr/bin/ruby is recent, portable ruby is cleaned up (it saves an other 40mb).
It is possible to make a symlink but it would nice to check in $PATH for a recent ruby.

I believe setting CI makes a shallow clone.