5

I've installed docker on mac os as written in documentation.

But in some docs (for example in the docker book) I see the recomendations to use man docker-run (man docker-pull, etc).

But when I run such command I get the error:

bessarabov@bessarabov-osx:~$ man docker
No manual entry for docker

How can I install docker man-documentation to my Mac OS system?

bessarabov
  • 11,151
  • 10
  • 34
  • 59
  • 1
    They are available in your VM, and from the source: https://github.com/docker/docker/blob/master/docs/man/docker-run.1.md – Krumelur Oct 14 '14 at 19:34
  • 1
    Thank you, I've cloned this repo so I have docs for offline use, but I still want to be able to use `man docker-run` on my mac os host. – bessarabov Oct 14 '14 at 20:07
  • 1
    The manpages are not part of the boot2docker installation. You could file an issue here: https://github.com/boot2docker/osx-installer/issues – Krumelur Oct 27 '14 at 14:37
  • @Krumelur Thank you! Here is the direct link to the issue with man pages https://github.com/boot2docker/osx-installer/issues/66 – bessarabov Oct 31 '14 at 22:05

4 Answers4

8

As of 2017.06.01, you have to git checkout your desired tag/version from

and then, go to the components/cli directory and execute:

make -f docker.Makefile manpages

To add the manpages to the manpath:

echo "MANPATH $PWD/man" | sudo tee -a /private/etc/man.conf

Source: https://github.com/docker/cli/issues/217

tekumara
  • 8,357
  • 10
  • 57
  • 69
ninrod
  • 523
  • 6
  • 25
  • Thanks! And I upvoted the current (as of Apr 2022) [github issue](https://github.com/docker/for-mac/issues/743#issuecomment-928969594) in the current (lol again) repo! – djeikyb Apr 11 '22 at 21:53
4

It looks like docker has slightly changed since @Sergiy's answer. Here is a slightly updated version that worked for me.

git clone https://github.com/docker/docker.git
cd docker/man                      # looks like the directory has moved up
docker build -t docker/md2man .    # don't forget the '.'
docker run -v $PWD/:/docs:rw -w /docs -i docker/md2man /docs/md2man-all.sh
sudo cp -R man* /usr/share/man/    # you'll likely need sudo access for this
man docker                         # check it worked
Community
  • 1
  • 1
Gilly
  • 1,739
  • 22
  • 30
  • 1
    This builds the master branch. If you want something that will build precisely the version of Docker you're using, check out this gist: https://gist.github.com/jasonmp85/9ab30cf7dfd1fb64cbe59cf55c2a7c4d – jasonmp85 Jun 02 '16 at 20:40
3

Until the issue is resolved you can build man pages manually via a docker container using the supplied Dockerfile and then just copy generated files to /usr/share/man/:

# Step 1: checkout docker sources, but make sure you do this
# somewhere in /Users directory because boot2docker can only
# share this path with docker containers
git clone https://github.com/docker/docker.git

# Step 2: build docker image  
cd docker/docs/man
docker build -t docker/md2man .

# Step 3: build man pages
docker run -v /Users/<path-to-git-dir>/docker/docs/man:/docs:rw \
-w /docs -i docker/md2man /docs/md2man-all.sh

# Step 4: copy generated man pages to /usr/share/man
cp -R man* /usr/share/man/

Enjoy!

Sergiy Sokolenko
  • 5,967
  • 35
  • 37
  • Except that as of 2016/11/17 step 2 runs into **"Update failed for golang.org/x/sys: Cannot detect VCS"** errors. Trying to trac those down leads to discussions on go and glide github repos about the right way to do imports in those two utilities; but no current solutions via these docker/md2man based answers. – jwd630 Nov 18 '16 at 02:26
0

It seems the go/glide bits under the hood of docker/md2man have changed since @gilly's answer. What I ended up doing, on Mac OS:

cd /usr/local
git clone https://github.com/docker/docker.git
brew install ruby
gem install md2man
cd docker/man
mkdir man1; for i in *.1.md; md2man-roff $i > man1/${i%.md}; done
cd /usr/local/share/man/man1
for i in ../../../docker/man/man1/*.1; do ln -s $i .; done
jwd630
  • 4,529
  • 1
  • 20
  • 22