linode

package module
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2018 License: MIT Imports: 11 Imported by: 0

README

docker-machine-linode

Linode Driver Plugin for docker-machine.

Install

First, docker-machine is required, documentation for how to install docker-machine is available here.

Or, you can install docker-machine from source by running:

go get github.com/docker/machine
cd $GOPATH/src/github.com/docker/machine
make build

Then, install docker-machine-linode driver in the $GOPATH and add $GOPATH/bin to the $PATH environment variable.

go get github.com/displague/docker-machine-linode
cd $GOPATH/src/github.com/displague/docker-machine-linode
make install

Run

You will need a Linode APIv4 Personal Access Token. Get one here: https://developers.linode.com/api/v4#section/Personal-Access-Token

docker-machine create -d linode --linode-token=<linode-token> --linode-root-pass=<linode-root-pass> linode
Full Example
LINODE_TOKEN=e332cf8e1a78427f1368a5a0a67946ad1e7c8e28e332cf8e1a78427f1368a5a0 # Should be 65 lowercase hex chars
LINODE_ROOT_PASSWORD=$(openssl rand -base64 32); echo Password for root: $LINODE_ROOT_PASSWORD

docker-machine create -d linode --linode-token=$LINODE_TOKEN --linode-root-pass=$LINODE_ROOT_PASSWORD linode
eval $(docker-machine env linode)
docker run --rm --it debian bash
$ docker-machine ls
NAME      ACTIVE   DRIVER   STATE     URL                        SWARM   DOCKER        ERRORS
linode    *        linode   Running   tcp://45.79.139.196:2376           v18.05.0-ce

$ docker-machine rm linode
About to remove linode
WARNING: This action will delete both local reference and remote instance.
Are you sure? (y/n): y
(default) Removing linode: 8753395
Successfully removed linode
Options
Argument Env Default Description
linode-token LINODE_TOKEN None required Linode APIv4 Token (see here)
linode-root-pass LINODE_ROOT_PASSWORD None required The Linode Instance root_pass (password assigned to the root account)
linode-label LINODE_LABEL generated The Linode Instance label. This label must be unique on the account.
linode-region LINODE_REGION us-east The Linode Instance region (see here)
linode-instance-type LINODE_INSTANCE_TYPE g6-standard-4 The Linode Instance type (see here)
linode-image LINODE_IMAGE linode/ubuntu18.04 The Linode Instance image which provides the Linux distribution (see here).
linode-kernel LINODE_KERNEL linode/grub2 The Linux Instance kernel to boot. linode/grub2 will defer to the distribution kernel. (see here (?page=N))
linode-ssh-port LINODE_SSH_PORT 22 The port that SSH is running on, needed for Docker Machine to provision the Linode.
linode-docker-port LINODE_DOCKER_PORT 2376 The TCP port of the Linode that Docker will be listening on
linode-swap-size LINODE_SWAP_SIZE 512 The amount of swap space provisioned on the Linode Instance

Discussion / Help

Join us at #linodego on the gophers slack

License

MIT License

Documentation

Index

Constants

View Source
const Version = "0.0.1"

Variables

This section is empty.

Functions

This section is empty.

Types

type Driver

type Driver struct {
	*drivers.BaseDriver

	APIToken   string
	IPAddress  string
	DockerPort int

	InstanceID    int
	InstanceLabel string

	Region         string
	InstanceType   string
	RootPassword   string
	SSHPort        int
	InstanceImage  string
	InstanceKernel string
	SwapSize       int
	// contains filtered or unexported fields
}

Driver is the implementation of BaseDriver interface

func NewDriver

func NewDriver(hostName, storePath string) *Driver

NewDriver

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)

Get IP Address for the Linode. Note that currently the IP Address is cached

func (*Driver) GetSSHHostname

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

func (*Driver) GetSSHUsername

func (d *Driver) GetSSHUsername() string

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

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