-
-
Save jm-g/747a0be8352cf18339f56e9db5acd1f5 to your computer and use it in GitHub Desktop.
Install Docker man pages for your Docker version
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# make bash behave | |
set -euo pipefail | |
IFS=$'\n\t' | |
# adapted from: http://stackoverflow.com/a/32239112 | |
# create tmpdir and register cleanup callback | |
tmpdir=$(mktemp -d ~/.docker-man.XXXXXXXX) | |
cd "${tmpdir}" | |
function cleanup { | |
# docker-clean -c | |
rm -rf "${tmpdir}" | |
} | |
trap cleanup EXIT | |
# ensure we're getting the right doc version | |
dockerversion=$(docker version -f '{{ .Client.Version }}') | |
git clone --quiet --branch "v${dockerversion}" --depth 1 \ | |
https://github.com/docker/docker.git | |
cd docker/man | |
docker build -t docker/md2man . | |
docker run -v $(pwd):/man -w /man -i docker/md2man ./md2man-all.sh | |
cp -Rv man* /usr/local/share/man/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment