github.com/emreu/go-swagger@v0.22.1/docs/install.md (about)

     1  # Installing
     2  
     3  **IMPORTANT NOTE**: `go-swagger` is a tool to mainly generate or analyze source code. In order to make it work after successful
     4  installation, see [the prerequisites](https://goswagger.io/generate/requirements.html) on your development environment.
     5  
     6  ## Installing from binary distributions
     7  
     8  go-swagger releases are distributed as binaries that are built from signed tags. It is published [as github release](https://github.com/go-swagger/go-swagger/tags),
     9  rpm, deb and docker image.
    10  
    11  ### Docker image [![Docker Repository on Quay](https://quay.io/repository/goswagger/swagger/status "Docker Repository on Quay")](https://quay.io/repository/goswagger/swagger)
    12  
    13  First grab the image:
    14  
    15  ```
    16  docker pull quay.io/goswagger/swagger
    17  ```
    18  
    19  #### For Mac And Linux users:
    20  
    21  ```bash
    22  alias swagger="docker run --rm -it -e GOPATH=$HOME/go:/go -v $HOME:$HOME -w $(pwd) quay.io/goswagger/swagger"
    23  swagger version
    24  ```
    25  
    26  #### For windows users:
    27  
    28  ```cmd
    29  docker run --rm -it --env GOPATH=/go -v %CD%:/go/src -w /go/src quay.io/goswagger/swagger
    30  ```
    31  
    32  You can put the following in a file called **swagger.bat** and include it in your path environment variable to act as an alias.
    33  
    34  ```batch
    35  @echo off
    36  echo.
    37  docker run --rm -it --env GOPATH=/go -v %CD%:/go/src -w /go/src quay.io/goswagger/swagger %*
    38  ```
    39  
    40  ### Homebrew/Linuxbrew
    41  
    42  ```
    43  brew tap go-swagger/go-swagger
    44  brew install go-swagger
    45  ```
    46  
    47  ### Static binary
    48  
    49  You can download a binary for your platform from github:
    50  <https://github.com/go-swagger/go-swagger/releases/latest>
    51  
    52  ```
    53  download_url=$(curl -s https://api.github.com/repos/go-swagger/go-swagger/releases/latest | \
    54    jq -r '.assets[] | select(.name | contains("'"$(uname | tr '[:upper:]' '[:lower:]')"'_amd64")) | .browser_download_url')
    55  curl -o /usr/local/bin/swagger -L'#' "$download_url"
    56  chmod +x /usr/local/bin/swagger
    57  ```
    58  
    59  ### Debian packages [ ![Download](https://api.bintray.com/packages/go-swagger/goswagger-debian/swagger/images/download.svg) ](https://bintray.com/go-swagger/goswagger-debian/swagger/_latestVersion)
    60  
    61  This repo will work for any debian, the only file it contains gets copied to `/usr/bin`
    62  
    63  ```
    64  sudo apt install gnupg ca-certificates
    65  sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 379CE192D401AB61
    66  echo "deb https://dl.bintray.com/go-swagger/goswagger-debian ubuntu main" | sudo tee /etc/apt/sources.list.d/goswagger.list
    67  apt update 
    68  apt install swagger
    69  ```
    70  
    71  ### RPM packages [ ![Download](https://api.bintray.com/packages/go-swagger/goswagger-rpm/swagger/images/download.svg) ](https://bintray.com/go-swagger/goswagger-rpm/swagger/_latestVersion)
    72  
    73  This repo should work on any distro that wants rpm packages, the only file it contains gets copied to `/usr/bin`
    74  
    75  ```
    76  wget https://bintray.com/go-swagger/goswagger-rpm/rpm -O bintray-go-swagger-goswagger-rpm.repo
    77  ```
    78  
    79  
    80  ### Installing from source
    81  
    82  Install or update from current source master:
    83  
    84  ```
    85  dir=$(mktemp -d) 
    86  git clone https://github.com/go-swagger/go-swagger "$dir" 
    87  cd "$dir"
    88  go install ./cmd/swagger
    89  ```
    90  
    91  You are welcome to clone this repo and start contributing:
    92  ```
    93  git clone https://github.com/go-swagger/go-swagger
    94  ```
    95  
    96  > **NOTE**: go-swagger works on *nix as well as Windows OS