|
9 | 9 | You need to create a project-sepcific access token under `Access` > `API Tokens` in the project control panel |
10 | 10 | and pass that to `docker-machine create` with the `--hetzner-api-token` option. |
11 | 11 |
|
| 12 | +## Setup |
12 | 13 |
|
13 | | -## Building |
| 14 | +### Go |
14 | 15 |
|
15 | | -Use an up-to-date version of [go](https://golang.org/dl) |
| 16 | +Use an up-to-date version of [Go](https://golang.org/dl) |
16 | 17 |
|
17 | 18 | To use the driver, you can download the sources and build it locally: |
18 | 19 |
|
19 | | - # Get sources and build the binary at ~/go/bin/docker-machine-driver-hetzner |
20 | | - go get github.com/jonasprogrammer/docker-machine-driver-hetzner |
| 20 | +```shell |
| 21 | +# Get sources and build the binary at ~/go/bin/docker-machine-driver-hetzner |
| 22 | +$ go get github.com/jonasprogrammer/docker-machine-driver-hetzner |
21 | 23 |
|
22 | | - # Make the binary accessible to docker-machine |
23 | | - export GOPATH=$(go env GOPATH) |
24 | | - export GOBIN=$GOPATH/bin |
25 | | - export PATH="$PATH:$GOBIN" |
| 24 | +# Make the binary accessible to docker-machine |
| 25 | +$ export GOPATH=$(go env GOPATH) |
| 26 | +$ export GOBIN=$GOPATH/bin |
| 27 | +$ export PATH="$PATH:$GOBIN" |
| 28 | +``` |
| 29 | +### Binary |
26 | 30 |
|
| 31 | +You can find sources and pre-compiled binaries [here](https://github.com/JonasProgrammer/docker-machine-driver-hetzner/releases). |
| 32 | + |
| 33 | +```shell |
| 34 | +# Download the binary (this example downloads the binary for linux amd64) |
| 35 | +$ wget https://github.com/JonasProgrammer/docker-machine-driver-hetzner/releases/download/0.2.4/docker-machine-driver-hetzner_0.2.4_linux_amd64.tar.gz |
| 36 | +$ tar -xvf docker-machine-driver-hetzner_0.2.4_linux_amd64.tar.gz |
| 37 | + |
| 38 | +# Make it executable and copy the binary in a directory accessible with your $PATH |
| 39 | +$ chmod +x docker-machine-driver-hetzner |
| 40 | +$ cp docker-machine-driver-hetzner /usr/local/bin/ |
| 41 | +``` |
27 | 42 |
|
28 | 43 | ## Usage |
29 | 44 |
|
@@ -86,24 +101,26 @@ was used during creation. |
86 | 101 |
|
87 | 102 | Fork this repository, yielding `github.com/<yourAccount>/docker-machine-driver-hetzner`. |
88 | 103 |
|
89 | | - # Get the sources of your fork and build it locally |
90 | | - go get github.com/<yourAccount>/docker-machine-driver-hetzner |
91 | | - |
92 | | - # * This integrates your fork into the $GOPATH (typically pointing at ~/go) |
93 | | - # * Your sources are at $GOPATH/src/github.com/<yourAccount>/docker-machine-driver-hetzner |
94 | | - # * That folder is a local Git repository. You can pull, commit and push from there. |
95 | | - # * The binary will typically be at $GOPATH/bin/docker-machine-driver-hetzner |
96 | | - # * In the source directory $GOPATH/src/github.com/<yourAccount>/docker-machine-driver-hetzner |
97 | | - # you may use go get to re-build the binary. |
98 | | - # * Note: when you build the driver from different repositories, e.g. from your fork |
99 | | - # as well as github.com/jonasprogrammer/docker-machine-driver-hetzner, |
100 | | - # the binary files generated by these builds are all called the same |
101 | | - # and will hence override each other. |
102 | | - |
103 | | - # Make the binary accessible to docker-machine |
104 | | - export GOPATH=$(go env GOPATH) |
105 | | - export GOBIN=$GOPATH/bin |
106 | | - export PATH="$PATH:$GOBIN" |
107 | | - |
108 | | - # Make docker-machine output help including hetzner-specific options |
109 | | - docker-machine create --driver hetzner |
| 104 | +```shell |
| 105 | +# Get the sources of your fork and build it locally |
| 106 | +$ go get github.com/<yourAccount>/docker-machine-driver-hetzner |
| 107 | + |
| 108 | +# * This integrates your fork into the $GOPATH (typically pointing at ~/go) |
| 109 | +# * Your sources are at $GOPATH/src/github.com/<yourAccount>/docker-machine-driver-hetzner |
| 110 | +# * That folder is a local Git repository. You can pull, commit and push from there. |
| 111 | +# * The binary will typically be at $GOPATH/bin/docker-machine-driver-hetzner |
| 112 | +# * In the source directory $GOPATH/src/github.com/<yourAccount>/docker-machine-driver-hetzner |
| 113 | +# you may use go get to re-build the binary. |
| 114 | +# * Note: when you build the driver from different repositories, e.g. from your fork |
| 115 | +# as well as github.com/jonasprogrammer/docker-machine-driver-hetzner, |
| 116 | +# the binary files generated by these builds are all called the same |
| 117 | +# and will hence override each other. |
| 118 | + |
| 119 | +# Make the binary accessible to docker-machine |
| 120 | +$ export GOPATH=$(go env GOPATH) |
| 121 | +$ export GOBIN=$GOPATH/bin |
| 122 | +$ export PATH="$PATH:$GOBIN" |
| 123 | + |
| 124 | +# Make docker-machine output help including hetzner-specific options |
| 125 | +$ docker-machine create --driver hetzner |
| 126 | +``` |
0 commit comments