Skip to content

montel-ig/docker-machine-driver-upcloud

 
 

Repository files navigation

UpCloud Docker Machine Driver

CircleCI

A docker-machine driver for UpCloud

Updated and maintained by Montel Intergalactic

Originally developed by Hanzo Studio

How to get it

The binary way

Download the latest binary from the releases page, place it somewhere in your path, like /usr/local/bin/ and make sure the binary is executable.

The go way

You must first have a working go development environment to get it this way.

  1. Download the code
$ git clone git@github.com:montel-ig/docker-machine-driver-upcloud
  1. Make sure the dependencies are installed and everything is in order
$ dep ensure
  1. Compile the code
$ make build

This will compile the file at ./bin/docker-machine-driver-upcloud and create a symlink at /usr/local/bin/ so the driver can be used. You can change that path to any directory which is available via $PATH on the Makefile.

How to use it

An UpCloud account with api access is needed to use this driver

Options:

$ docker-machine create --driver upcloud
Flag Parameters Description
--upcloud-user "username" upcloud api access user [$UPCLOUD_USER]
--upcloud-passwd "password upcloud api access password [$UPCLOUD_PASSWD]
--upcloud-plan "1xCPU-1GB" upcloud plan [$UPCLOUD_PLAN]
--upcloud-core-number 1 specify the number of cores [$UPCLOUD_CORE_NUMBER]
--upcloud-memory-amount 4 specify the amount (GB) of RAM to be assigned [$UPCLOUD_MEMORY_AMOUNT]
--upcloud-storage 25 the storage available for the server [$UPCLOUD_STORAGE]
--upcloud-ssh-user "root" username [$UPCLOUD_SSH_USER]
--upcloud-template "01000000-0000-4000-8000-000030080200" template [$UPCLOUD_TEMPLATE]
--upcloud-use-private-network to use private networking [$UPCLOUD_USE_PRIVATE_NETWORK]
--upcloud-use-private-network-only this flag to only use private networking [$UPCLOUD_USE_PRIVATE_NETWORK_ONLY]
--upcloud-userdata "~/meerkat/cloud-init.sh" path to file with cloud-init user-data [$UPCLOUD_USERDATA]
--upcloud-zone "de-fra1" zone [$UPCLOUD_ZONE]

Example run:

$ docker-machine create \
--driver upcloud \
--upcloud-user "user" \
--upcloud-passwd "password"
machine_name

Developing

The repository includes a Makefile with the commands required to develop the project.

To test the driver locally, run

$ make install

This will compile the driver and copy it to your $GOPATH/bin directory, so it's accessible to Docker via $PATH.

After this, you can run it normally with docker-machine

$ docker-machine create --driver upcloud #...

If you want to remove the installed driver, run

$ make uninstall

This will remove the compiled driver from $GOPATH/bin.

Releasing

A command for building different versions is also included to simplify the distribution of the driver to different platforms.

To build the driver for release, run

$ make build-all

This will compile the driver for MacOS, Linux, and Windows, for the 368 and amd64 architectures. If you need to compile to a different target, you can modify the TARGET_OS or TARGET_ARCH variables on the Makefile.

To make the distribution easier, the build will also create a directory with the compressed driver for each platform. You can find those under dist/compressed.

Issues, contributions and comments.

Issues, contributions, and comments are always welcome. Feel free to submit an issue or pull request with your contributions.


Made with ❤️ from 🇫🇮