Skip to content

Instantly share code, notes, and snippets.

@jmmaranan
Last active April 19, 2020 20:38
Show Gist options
  • Save jmmaranan/af06216a7bf9daad61435be9e0670992 to your computer and use it in GitHub Desktop.
Save jmmaranan/af06216a7bf9daad61435be9e0670992 to your computer and use it in GitHub Desktop.
Windows docker run swagger
:: Credits from Go-Swagger itself: https://goswagger.io/install.html#for-windows-users
:: Same approach can be used for other Windows Host + Linux Containers,
:: which can completely replace some development setup command line tools.
::
:: `--rm` - eliminates the need for a lot of dangling containers each time the command script is run.
::
:: The `-v %CD%:<container path>` then `-w <that same container path>` makes the current directory
:: in the host universally accessible to the container.
::
:: `%*` - this accepts any param after the docker image
@echo off
echo.
docker run --rm -it --env GOPATH=/go -v %CD%:/go/src -w /go/src quay.io/goswagger/swagger %*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment