├── img └── docker-manpages-osx.png ├── Dockerfile ├── docker-man-pages-osx.sh └── README.md /img/docker-manpages-osx.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cmosetick/docker-manpages-osx/HEAD/img/docker-manpages-osx.png -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | # docker build . -t docker-man-pages-osx:latest 2 | FROM savant/md2man 3 | LABEL maintainer Chris Mosetick 4 | RUN \ 5 | apk add --update --no-cache bash && \ 6 | rm -rf /var/cache/apk/* && \ 7 | ln -s /bin/md2man /bin/go-md2man 8 | -------------------------------------------------------------------------------- /docker-man-pages-osx.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # originally adapted from: http://stackoverflow.com/a/32239112 4 | 5 | docker build . -t docker-man-pages-osx 6 | 7 | mkdir -p $HOME/temp 8 | cd $HOME/temp 9 | git clone -b docs --single-branch https://github.com/moby/moby.git 10 | 11 | cd moby/man 12 | 13 | docker run --rm -v $PWD/:/man:rw -w /man -i --entrypoint=/man/md2man-all.sh docker-man-pages-osx:latest 14 | 15 | cp -R man* /usr/local/share/man/ # no sudo for homebrew location 16 | rm -rf $HOME/temp/moby # cleanup 17 | ls -l /usr/local/share/man/man1/docker* 18 | ls -l /usr/local/share/man/man5/docker* 19 | ls -l /usr/local/share/man/man8/docker* 20 | 21 | echo "TEST A DOCKER MAN PAGE" 22 | man docker 23 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Docker Man Pages for OS X 2 | ========================= 3 | 4 | **Install the man pages for `docker` on your Mac OS X system using docker and go-md2man.** 5 | 6 | Useful when combined with [Docker for Mac](https://docs.docker.com/docker-for-mac/), [dlite](https://github.com/nlf/dlite) or [Triton](https://docs.joyent.com/public-cloud/api-access/docker) 7 | 8 | ![alt text](img/docker-manpages-osx.png "example of docker man pages OS X") 9 | 10 | ## Prereqs 11 | - The script assumes that you are using Mac Homebrew on your OS X system. (http://brew.sh) 12 | 13 | - The script assumes you have `docker` and `git` installed and an active internet connection to pull the docker git repository and a docker image to your local system. 14 | 15 | ## Usage 16 | 17 | To install the man pages, just run the script: 18 | `./docker-man-pages-osx.sh` 19 | 20 | Then to view any docker related man page, just use man like normal! 21 | **Perfect for offline usage!** 22 | 23 | ``` 24 | # examples 25 | man docker 26 | man Dockerfile 27 | man docker-run 28 | man docker-inspect 29 | man docker-exec 30 | man docker-attach 31 | etc, etc. 32 | ``` 33 | 34 | For a full listing of all the man pages that get installed run: 35 | ``` 36 | ls -l /usr/local/share/man/man1/docker* 37 | ls -l /usr/local/share/man/man5/docker* 38 | ls -l /usr/local/share/man/man5/Dockerfile* 39 | ls -l /usr/local/share/man/man8/docker* 40 | ``` 41 | 42 | 43 | ## Caveats 44 | - Not all the generated man pages will apply to your Docker installation on a Mac. Nevertheless, the bulk of these are still useful for quick reference without leaving the terminal or for offline usage. 45 | 46 | - These man pages are installed outside of Homebrew, therefore are likely to be out of date or stale or out of sync with your currently installed version of docker at any given time. 47 | 48 | - Run the script occasionally to update the pages in the event that the Docker core team updates things on their side. 49 | 50 | ## go-md2man 51 | current: https://hub.docker.com/r/savant/md2man/ 52 | 53 | original: https://github.com/cpuguy83/go-md2man 54 | (image not found on Docker Hub anymore as of 2017-03-05) 55 | 56 | ### References 57 | 58 | Originally adapted from: 59 | http://stackoverflow.com/a/32239112 60 | Stackoverflow users: [Serg](http://stackoverflow.com/users/131337/serg) + [Gilly](http://stackoverflow.com/users/3903368/gilly) 61 | --------------------------------------------------------------------------------