Skip to content

Instantly share code, notes, and snippets.

@knight42
Last active December 24, 2017 08:43
Show Gist options
  • Select an option

  • Save knight42/c838237e8f8757ae31e635de68da3563 to your computer and use it in GitHub Desktop.

Select an option

Save knight42/c838237e8f8757ae31e635de68da3563 to your computer and use it in GitHub Desktop.
#!/bin/bash
SWAGGER_DOCS_PORT=${SWAGGER_DOCS_PORT:-8080}
d=$(mktemp -d)
cd $d || exit 1
wget -q https://raw.githubusercontent.com/moby/moby/master/api/swagger.yaml
docker run --rm -tid -v "$PWD/swagger.yaml":/usr/share/nginx/html/swagger.yaml \
-e 'REDOC_OPTIONS=hide-hostname="true" lazy-rendering' \
-p $SWAGGER_DOCS_PORT:80 \
bfirsh/redoc:1.6.2
echo "Serving on http://127.0.0.1:$SWAGGER_DOCS_PORT"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment