scaleway/docker-machine-driver-scaleway
Go
Captured source
source ↗scaleway/docker-machine-driver-scaleway
Description: :whale: Scaleway driver for Docker Machine
Language: Go
License: MIT
Stars: 244
Forks: 32
Open issues: 18
Created: 2016-04-13T22:11:16Z
Pushed: 2023-12-18T23:02:27Z
Default branch: master
Fork: no
Archived: no
README:
Overview

A 3rd-party driver plugin for Docker machine to manage your containers on the servers of Scaleway
Setup
Homebrew
# install latest release of docker-machine-driver-scaleway and docker-machine using homebrew $ brew tap scaleway/scaleway $ brew install scaleway/scaleway/docker-machine-driver-scaleway # install latest (git) version of docker-machine-driver-scaleway $ brew tap scaleway/scaleway $ brew install scaleway/scaleway/docker-machine-driver-scaleway --HEAD
Go
# install latest (git) version of docker-machine-driver-scaleway in your $GOPATH/bin (depends on Golang and docker-machine) $ go get -u github.com/scaleway/docker-machine-driver-scaleway
Binary
You can find sources and pre-compiled binaries here
# Download the binary (this example downloads the binary for darwin amd64) $ curl -sL https://github.com/scaleway/docker-machine-driver-scaleway/releases/download/v1.2.1/docker-machine-driver-scaleway_1.2.1_darwin_amd64.zip -O $ unzip docker-machine-driver-scaleway_1.2.1_darwin_amd64.zip # Make it executable and copy the binary in a directory accessible with your $PATH $ chmod +x docker-machine-driver-scaleway_1.2.1_darwin_amd64/docker-machine-driver-scaleway $ sudo cp docker-machine-driver-scaleway_1.2.1_darwin_amd64/docker-machine-driver-scaleway /usr/local/bin/
Usage
1. Get your Scaleway credentials
You can find your ACCESS KEY and generate your TOKEN here
2. Scaleway driver helper
$ docker-machine create -d scaleway -h Usage: docker-machine create [OPTIONS] [arg...] Create a machine Description: Run 'docker-machine create --driver name' to include the create flags for that driver in the help text. Options: --driver, -d "none" Driver to create machine with. [$MACHINE_DRIVER] --engine-env [--engine-env option --engine-env option] Specify environment variables to set in the engine --engine-insecure-registry [--engine-insecure-registry option --engine-insecure-registry option] Specify insecure registries to allow with the created engine --engine-install-url "https://get.docker.com" Custom URL to use for engine installation [$MACHINE_DOCKER_INSTALL_URL] --engine-label [--engine-label option --engine-label option] Specify labels for the created engine --engine-opt [--engine-opt option --engine-opt option] Specify arbitrary flags to include with the created engine in the form flag=value --engine-registry-mirror [--engine-registry-mirror option --engine-registry-mirror option] Specify registry mirrors to use [$ENGINE_REGISTRY_MIRROR] --engine-storage-driver Specify a storage driver to use with the engine --scaleway-commercial-type "VC1S" Specifies the commercial type [$SCALEWAY_COMMERCIAL_TYPE] --scaleway-debug Enables Scaleway client debugging [$SCALEWAY_DEBUG] --scaleway-image "ubuntu-xenial" Specifies the image [$SCALEWAY_IMAGE] --scaleway-bootscript "docker" Specifies the bootscript [$SCALEWAY_BOOTSCRIPT] --scaleway-ip Specifies the IP address [$SCALEWAY_IP] --scaleway-ipv6 Enable ipv6 [$SCALEWAY_IPV6] --scaleway-name Assign a name [$SCALEWAY_NAME] --scaleway-organization Scaleway organization [$SCALEWAY_ORGANIZATION] --scaleway-port "22" Specifies SSH port [$SCALEWAY_PORT] --scaleway-region "par1" Specifies the location (par1,ams1) [$SCALEWAY_REGION] --scaleway-token Scaleway token [$SCALEWAY_TOKEN] --scaleway-user "root" Specifies SSH user name [$SCALEWAY_USER] --scaleway-volumes Attach additional volume (e.g., 50G) [$SCALEWAY_VOLUMES] --swarm Configure Machine to join a Swarm cluster --swarm-addr addr to advertise for Swarm (default: detect and use the machine IP) --swarm-discovery Discovery service to use with Swarm --swarm-experimental Enable Swarm experimental features --swarm-host "tcp://0.0.0.0:3376" ip/socket to listen on for Swarm master --swarm-image "swarm:latest" Specify Docker image to use for Swarm [$MACHINE_SWARM_IMAGE] --swarm-join-opt [--swarm-join-opt option --swarm-join-opt option] Define arbitrary flags for Swarm join --swarm-master Configure Machine to be a Swarm master --swarm-opt [--swarm-opt option --swarm-opt option] Define arbitrary flags for Swarm master --swarm-strategy "spread" Define a default scheduling strategy for Swarm --tls-san [--tls-san option --tls-san option] Support extra SANs for TLS certs
3. Create your machine
You need to configure your ACCESS_KEY and TOKEN, we suggest you to install scw and create a credential file using scw login.
In the following example, authentication is done without any other dependencies using the --scaleway-token=TOKEN and --scaleway-organization=ACCESS_KEY parameters.
$ docker-machine create -d scaleway --scaleway-token=TOKEN --scaleway-organization=ORGANIZATION_ID --scaleway-name="cloud-scaleway-1" cloud-scaleway Running pre-create checks... Creating machine... (cloud-scaleway) Creating SSH key... (cloud-scaleway) Creating server... (cloud-scaleway) Starting server... Waiting for machine to be running, this may take a few minutes... Detecting operating system of created instance... Waiting for SSH to be available... Detecting the provisioner... Provisioning with ubuntu(upstart)... Installing Docker... Copying certs to the local machine directory... Copying certs to the remote machine... Setting Docker configuration on the remote daemon... Checking connection to Docker... Docker is up and running! To see how to connect your Docker Client to the Docker Engine running on this virtual machine, run: docker-machine env cloud-scaleway
Note that you can store these parameters in the environment variables SCALEWAY_TOKEN and SCALEWAY_ORGANIZATION.
4. Test your machine
$ eval $(docker-machine env cloud-scaleway) # loads environment variables to use your machine $ docker-machine ls # cloud-scaleway is now activated NAME ACTIVE DRIVER STATE URL SWARM…
Excerpt shown — open the source for the full document.