Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Install Docker man pages for your Docker version
#!/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
make manpages
cd man
cp -R man* /usr/local/share/man/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.