brightbox

package module
v0.0.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 18, 2015 License: MIT Imports: 15 Imported by: 0

README

Brightbox Cloud driver for Docker Machine

Install this driver in your PATH and you can create docker hosts with ease on Brightbox Cloud.

If you are new to Brightbox Cloud you can sign up in 2 minutes and get your user credentials. You'll get a £20 credit to get you started creating Docker hosts.

Installation

From a Release

Official release versions of the driver include a binary for Linux, MacOS and Windows. You can find them on the GitHub releases page.

Pick the binary you require, download it into a directory on your PATH as a file called docker-machine-driver-brightbox and make it executable.

Linux:

curl -sSL -o ~/bin/docker-machine-driver-brightbox \
https://github.com/brightbox/docker-machine-driver-brightbox/releases/download/v0.0.4/bin.docker-machine-driver-brightbox_linux-amd64 && \
chmod 755 ~/bin/docker-machine-driver-brightbox

Mac OSX

sudo curl -sSL -o /usr/local/bin/docker-machine-driver-brightbox https://github.com/brightbox/docker-machine-driver-brightbox/releases/download/v0.0.4/bin.docker-machine-driver-brightbox_darwin-amd64 &&
sudo chmod 755 /usr/local/bin/docker-machine-driver-brightbox
From Source

To build and install, first clone this repo onto a server running Docker, then run:

$ make containerbuild && sudo make install

which will install the driver into /usr/local/bin

Obtaining credentials

To use the driver you will need to create a 'Full Privileges' API client within Brightbox Manager. If you're collaborating with other Brightbox Users, make sure you select the correct account first or, if you have insufficient privileges, obtain the API client details from the owner of the account.

Using the driver

To use the driver first make sure you are running at least version 0.5.1 of docker-machine.

$ docker-machine -v
docker-machine version 0.5.1 (7e8e38e)

Check that docker-machine can see the Brightbox driver by asking for the driver help.

$ docker-machine create -d brightbox | more
Usage: docker-machine create [OPTIONS] [arg...]

## Create a machine.

Specify a driver with --driver to include the create flags for that driver in the help text.

Options:

   --brightbox-account 								Brightbox Cloud Account to operate on [$BRIGHTBOX_ACCOUNT]
   --brightbox-api-url "https://api.gb1.brightbox.com/"				Brightbox Cloud Api URL for selected Region [$BRIGHTBOX_API_URL]
...

To create a machine you'll need the API Client details you obtained earlier.

Then creating a Docker host is as simple as

$ docker-machine create -d brightbox --brightbox-client cli-xyzab \
--brightbox-client-secret Secret example
Running pre-create checks...
Creating machine...
Waiting for machine to be running, this may take a few minutes...
Machine is running, waiting for SSH to be available...
Detecting operating system of created instance...
Provisioning created instance...
Copying certs to the local machine directory...
Copying certs to the remote machine...
Setting Docker configuration on the remote daemon...
To see how to connect Docker to this machine, run: docker-machine env example

or if you don't want your client secret displayed anywhere:

$ (export BRIGHTBOX_CLIENT_SECRET;
read -s -p "Enter Secret: " BRIGHTBOX_CLIENT_SECRET && \
docker-machine create -d brightbox \
--brightbox-client cli-xyzab  example)

This creates a small server in the default server group for the account, and accesses the server over IPv6.

If you are running docker-machine on another server on the same Brightbox Cloud account and are using the default firewall policy, then this will work straight away. If you're running docker-machine from elsewhere then you'll need to alter your firewall policy first to allow access in to Docker on TCP port 2376. Make sure this rule is tight as there is no authentication on the Docker port.

Changing the settings

The driver has several options that you can use to get precisely the Docker host you want. You can see them all in the help list by running docker-machine create -d brightbox | more

Here are the most useful options:

  • --brightbox-type

    By default docker-machine creates a small 1gb SSD server as the Docker host. If you want a larger one, check the server sizing page for the available sizes, and then specify the memory size plus either .ssd or .ssd-high-io (for the larger disk version). So if you want a 4GB server just use 4gb.ssd for this option.

    For more details on the available ids and handles use the CLI brightbox types command

  • --brightbox-image

    You can select the image you want to use for the Docker host by specifying the img-xxxxx id of the image you require. You can get the image id from the Image Library in Brightbox Manager or via the CLI. Remember that Docker requires a 64-bit operating system.

  • --brightbox-group

    You can add server groups, and therefore firewall policies using the --brightbox-group option. Remember firewall policies are cumulative on Brightbox Cloud and specifying groups replaces the default option of putting the server in the default group.

  • --brightbox-zone

    Every Region on Brightbox Cloud has multiple availability zones within it. Normally the default auto-allocation does the right thing but if you want specific placement then specify the zone id or handle with this option.

    For more details on the available ids and handles use the CLI brightbox zones command

  • --brightbox-ipv4

    This is a flag that makes docker-machine access the server over IPv4 rather than IPv6. Brightbox servers run on a private IPv4 network by default, so this will stop external access to the server from unless you map a Cloud IP in Brightbox Manager or via the CLI.

Help

If you need help using this driver, drop an email to support at brightbox dot com.

License

This code is released under an MIT License.

Copyright (c) 2015 Brightbox Systems Ltd.

Documentation

Overview

Package brightbox is the Brightbox Cloud Driver for Docker Machine

Index

Constants

View Source
const (
	//DefaultArch is the default image archiecture
	DefaultArch = "x86_64"
	//DefaultImageTag is looked for in the name of the Image
	DefaultImageTag = "CoreOS"
)

Variables

This section is empty.

Functions

func GetDefaultImage

func GetDefaultImage(images []brightbox.Image) (*brightbox.Image, error)

GetDefaultImage searches the supplied Image List for official Images and selects one according to the constant definitions in this file. Returns a reference to that Image. If no Image matches the default settings you will get an error.

Types

type Driver

type Driver struct {
	drivers.BaseDriver

	brightbox.ServerOptions
	MachineID string
	IPv6      bool
	// contains filtered or unexported fields
}

Driver contains the details necessary for docker-machine to access the Brightbox Cloud

func NewDriver

func NewDriver(hostName, storePath string) Driver

NewDriver is a backward compatible Driver factory method. Using new(brightbox.Driver) is preferred

func (*Driver) Create

func (d *Driver) Create() error

func (*Driver) DriverName

func (d *Driver) DriverName() string

func (*Driver) GetCreateFlags

func (d *Driver) GetCreateFlags() []mcnflag.Flag

func (*Driver) GetIP

func (d *Driver) GetIP() (string, error)

func (*Driver) GetSSHHostname

func (d *Driver) GetSSHHostname() (string, error)

func (*Driver) GetState

func (d *Driver) GetState() (state.State, error)

func (*Driver) GetURL

func (d *Driver) GetURL() (string, error)

func (*Driver) Kill

func (d *Driver) Kill() error

func (*Driver) PreCreateCheck

func (d *Driver) PreCreateCheck() error

PreCreateCheck makes sure that the image details are complete

func (*Driver) Remove

func (d *Driver) Remove() error

func (*Driver) Restart

func (d *Driver) Restart() error

func (*Driver) SetConfigFromFlags

func (d *Driver) SetConfigFromFlags(flags drivers.DriverOptions) error

func (*Driver) Start

func (d *Driver) Start() error

func (*Driver) Stop

func (d *Driver) Stop() error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL