Giter Club home page Giter Club logo

Comments (5)

JonasProgrammer avatar JonasProgrammer commented on May 30, 2024

I'll try and update it this weekend. In the meantime, here's the quick version: Check out the repository somewhere and cd into it. Use go build then in order to generate an executable (make sure the result is named docker-machine-driver-hetzner).
Put this executable somewhere into your PATH then. You should be able to type docker-machine-driver-hetzner from some other directory and still execute the file (it'll generate an error, that's fine).

Then use docker-machine as described in the Usage section. It'll auto-execute the corresponding driver file, given that it is in path.

from docker-machine-driver-hetzner.

monochromata avatar monochromata commented on May 30, 2024

Cool, thanks! I tried it out and was able to build stuff. Some input (due to errors I saw on Linux):

  • There is a minimum version of Go required (when I used go 1.6.2 that was installed by my Linux distribution, I got errors like main.go:4:2: cannot find package "github.com/docker/machine/libmachine/drivers/plugin"). go build worked fine when using go version 1.9.3 from https://golang.org/dl/. When the binary was renamed and available via $PATH, I was able to make docker-machine use the driver.
  • When I changed the usage description of the hetzner-api-token in driver/driver.go from Project-specific Hetzner API token to Project-specific Hetzner API token (HAHA) in driver\driver.go, did go build and mv ... again, this had no effect on the output of docker-machine create --driver hetzner. Do I need to build driver/driver.go separately?

I'll continue trying out what I have so far, no need to hurry :-)

from docker-machine-driver-hetzner.

JonasProgrammer avatar JonasProgrammer commented on May 30, 2024

Little self-disclosure here, I'm not the most fluent go-speaker either, but it's by far the easiest way to interact with the whole docker ecosystem. That being said, I mostly leave the organizational work over to GoLand and hope it doesn't break stuff.
My answer wasn't really complete last night, but in self-defense, I had spent 10 hours of system moving for the 'you work with computers, don't you?'-type relative before.

So let me elaborate a bit more: In go, you usually work in a fixed directory structure, the root of which is indicated by $GOPATH. You then have a src sub-folder there, where packages' sources go in. The folder structure should match the package structure (that is, this driver should be in src/github.com/jonasprogrammer/docker-machine-driver-hetzner). Most likely your build command downloaded the driver-subpackage there, thus ignoring your changes. As for dependencies, you should run go get -d from the package's main directory once, in order to download all required dependencies.
Instead of this manual checkout, you can also just go get -d github.com/jonasprogrammer/docker-machine-driver-hetzner.
It gets even easier with go get github.com/jonasprogrammer/docker-machine-driver-hetzner (UPDATE: no -i flag, just plain go get without -d), which automatically builds everything and drops the executable to $GOPATH/bin.

Again sorry for the inconvenience, I'm used to my build environment, where stuff mostly 'just works'.

As for the (HAHA) part, has something changed about this? The documentation is still from the cloud-beta stages and the only changes I made were the new default server type and location disclaimer. Correct me, if something is wrong there.

from docker-machine-driver-hetzner.

monochromata avatar monochromata commented on May 30, 2024

Thanks for the explanation! I was able to build the driver and use it to create a server via docker-machine. Don't mind the (HAHA) it was just a not-random-enough random string to modify the code. I should have used (FOO) or so ...

I find it a bit confusing to checkout sources and have the build download and use other sources then. I'll try to assemble a pull request to change that :-).

from docker-machine-driver-hetzner.

JonasProgrammer avatar JonasProgrammer commented on May 30, 2024

Thanks a lot for your contribution and fixing it in #2. Feel free to reopen, if there's more to do

from docker-machine-driver-hetzner.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.