|
2 | 2 |
|
3 | 3 | [](https://goreportcard.com/report/github.com/JonasProgrammer/docker-machine-driver-hetzner) |
4 | 4 | [](https://opensource.org/licenses/MIT) |
| 5 | +[](http://travis-ci.org/JonasProgrammer/docker-machine-driver-hetzner) |
5 | 6 |
|
6 | 7 | > This library adds the support for creating [Docker machines](https://github.com/docker/machine) hosted on the [Hetzner Cloud](hetzner.de/cloud). |
7 | 8 |
|
8 | | -You need to create a project-sepcific access token under `Access` > `API Tokens` in the project control panel |
| 9 | +You need to create a project-specific access token under `Access` > `API Tokens` in the project control panel |
9 | 10 | and pass that to `docker-machine create` with the `--hetzner-api-token` option. |
10 | 11 |
|
| 12 | +## Installation |
11 | 13 |
|
12 | | -## Building |
| 14 | +You can find sources and pre-compiled binaries [here](https://github.com/JonasProgrammer/docker-machine-driver-hetzner/releases). |
13 | 15 |
|
14 | | -Use an up-to-date version of [go](https://golang.org/dl) |
15 | | - |
16 | | -To use the driver, you can download the sources and build it locally: |
17 | | - |
18 | | - # Get sources and build the binary at ~/go/bin/docker-machine-driver-hetzner |
19 | | - go get github.com/jonasprogrammer/docker-machine-driver-hetzner |
20 | | - |
21 | | - # Make the binary accessible to docker-machine |
22 | | - export GOPATH=$(go env GOPATH) |
23 | | - export GOBIN=$GOPATH/bin |
24 | | - export PATH="$PATH:$GOBIN" |
| 16 | +```shell |
| 17 | +# Download the binary (this example downloads the binary for linux amd64) |
| 18 | +$ 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 |
| 19 | +$ tar -xvf docker-machine-driver-hetzner_0.2.4_linux_amd64.tar.gz |
25 | 20 |
|
| 21 | +# Make it executable and copy the binary in a directory accessible with your $PATH |
| 22 | +$ chmod +x docker-machine-driver-hetzner |
| 23 | +$ cp docker-machine-driver-hetzner /usr/local/bin/ |
| 24 | +``` |
26 | 25 |
|
27 | 26 | ## Usage |
28 | 27 |
|
29 | 28 | $ docker-machine create \ |
30 | | - --driver hetzner \ |
31 | | - --hetzner-api-token=QJhoRT38JfAUO037PWJ5Zt9iAABIxdxdh4gPqNkUGKIrUMd6I3cPIsfKozI513sy \ |
32 | | - some-machine |
| 29 | + --driver hetzner \ |
| 30 | + --hetzner-api-token=QJhoRT38JfAUO037PWJ5Zt9iAABIxdxdh4gPqNkUGKIrUMd6I3cPIsfKozI513sy \ |
| 31 | + some-machine |
33 | 32 |
|
34 | 33 | ### Using environment variables |
35 | 34 |
|
36 | 35 | $ HETZNER_API_TOKEN=QJhoRT38JfAUO037PWJ5Zt9iAABIxdxdh4gPqNkUGKIrUMd6I3cPIsfKozI513sy \ |
37 | 36 | && HETZNER_IMAGE=centos-7 \ |
38 | 37 | && docker-machine create \ |
39 | | - --driver hetzner \ |
40 | | - some-machine |
| 38 | + --driver hetzner \ |
| 39 | + some-machine |
41 | 40 |
|
42 | 41 |
|
43 | 42 | ## Options |
44 | 43 |
|
45 | | -- `--hetzner-api-token`: **required**. Your project-specific access token for the Hetzner CLoud API. |
| 44 | +- `--hetzner-api-token`: **required**. Your project-specific access token for the Hetzner Cloud API. |
46 | 45 | - `--hetzner-image`: The name of the Hetzner Cloud image to use, see [Images API](https://docs.hetzner.cloud/#resources-images-get) for how to get a list. |
47 | 46 | - `--hetzner-server-type`: The type of the Hetzner Cloud server, see [Server Types API](https://docs.hetzner.cloud/#resources-server-types-get) for how to get a list. |
48 | 47 | - `--hetzner-server-location`: The location to create the server in, see [Locations API](https://docs.hetzner.cloud/#resources-locations-get) for how to get a list. |
@@ -81,28 +80,46 @@ was used during creation. |
81 | 80 | | `--hetzner-existing-key-id` | `HETZNER_EXISTING_KEY_ID` | 0 *(upload new key)* | |
82 | 81 |
|
83 | 82 |
|
| 83 | +## Building from source |
| 84 | + |
| 85 | +Use an up-to-date version of [Go](https://golang.org/dl) |
| 86 | + |
| 87 | +To use the driver, you can download the sources and build it locally: |
| 88 | + |
| 89 | +```shell |
| 90 | +# Get sources and build the binary at ~/go/bin/docker-machine-driver-hetzner |
| 91 | +$ go get github.com/jonasprogrammer/docker-machine-driver-hetzner |
| 92 | + |
| 93 | +# Make the binary accessible to docker-machine |
| 94 | +$ export GOPATH=$(go env GOPATH) |
| 95 | +$ export GOBIN=$GOPATH/bin |
| 96 | +$ export PATH="$PATH:$GOBIN" |
| 97 | +``` |
| 98 | + |
84 | 99 | ## Development |
85 | 100 |
|
86 | 101 | Fork this repository, yielding `github.com/<yourAccount>/docker-machine-driver-hetzner`. |
87 | 102 |
|
88 | | - # Get the sources of your fork and build it locally |
89 | | - go get github.com/<yourAccount>/docker-machine-driver-hetzner |
90 | | - |
91 | | - # * This integrates your fork into the $GOPATH (typically pointing at ~/go) |
92 | | - # * Your sources are at $GOPATH/src/github.com/<yourAccount>/docker-machine-driver-hetzner |
93 | | - # * That folder is a local Git repository. You can pull, commit and push from there. |
94 | | - # * The binary will typically be at $GOPATH/bin/docker-machine-driver-hetzner |
95 | | - # * In the source directory $GOPATH/src/github.com/<yourAccount>/docker-machine-driver-hetzner |
96 | | - # you may use go get to re-build the binary. |
97 | | - # * Note: when you build the driver from different repositories, e.g. from your fork |
98 | | - # as well as github.com/jonasprogrammer/docker-machine-driver-hetzner, |
99 | | - # the binary files generated by these builds are all called the same |
100 | | - # and will hence override each other. |
101 | | - |
102 | | - # Make the binary accessible to docker-machine |
103 | | - export GOPATH=$(go env GOPATH) |
104 | | - export GOBIN=$GOPATH/bin |
105 | | - export PATH="$PATH:$GOBIN" |
106 | | - |
107 | | - # Make docker-machine output help including hetzner-specific options |
108 | | - docker-machine create --driver hetzner |
| 103 | +```shell |
| 104 | +# Get the sources of your fork and build it locally |
| 105 | +$ go get github.com/<yourAccount>/docker-machine-driver-hetzner |
| 106 | + |
| 107 | +# * This integrates your fork into the $GOPATH (typically pointing at ~/go) |
| 108 | +# * Your sources are at $GOPATH/src/github.com/<yourAccount>/docker-machine-driver-hetzner |
| 109 | +# * That folder is a local Git repository. You can pull, commit and push from there. |
| 110 | +# * The binary will typically be at $GOPATH/bin/docker-machine-driver-hetzner |
| 111 | +# * In the source directory $GOPATH/src/github.com/<yourAccount>/docker-machine-driver-hetzner |
| 112 | +# you may use go get to re-build the binary. |
| 113 | +# * Note: when you build the driver from different repositories, e.g. from your fork |
| 114 | +# as well as github.com/jonasprogrammer/docker-machine-driver-hetzner, |
| 115 | +# the binary files generated by these builds are all called the same |
| 116 | +# and will hence override each other. |
| 117 | + |
| 118 | +# Make the binary accessible to docker-machine |
| 119 | +$ export GOPATH=$(go env GOPATH) |
| 120 | +$ export GOBIN=$GOPATH/bin |
| 121 | +$ export PATH="$PATH:$GOBIN" |
| 122 | + |
| 123 | +# Make docker-machine output help including hetzner-specific options |
| 124 | +$ docker-machine create --driver hetzner |
| 125 | +``` |
0 commit comments