machine

command module
v0.0.0-...-961e490 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2014 License: Apache-2.0 Imports: 19 Imported by: 0

README

Docker Machine

Machine makes it really easy to create Docker hosts on local hypervisors and cloud providers. It creates servers, installs Docker on them, then configures the Docker client to talk to them.

It works a bit like this:

$ machine create -d virtualbox dev
[info] Downloading boot2docker...
[info] Creating SSH key...
[info] Creating VirtualBox VM...
[info] Starting VirtualBox VM...
[info] Waiting for VM to start...
[info] "dev" has been created and is now the active host. Docker commands will now run against that host.

$ machine ls
NAME  	ACTIVE   DRIVER     	STATE 	URL
dev   	*    	virtualbox 	Running   tcp://192.168.99.100:2375

$ export DOCKER_HOST=`machine url` DOCKER_AUTH=identity

$ docker run busybox echo hello world
Unable to find image 'busybox' locally
Pulling repository busybox
e72ac664f4f0: Download complete
511136ea3c5a: Download complete
df7546f9f060: Download complete
e433a6c5b276: Download complete
hello world

$ machine create -d digitalocean --digitalocean-access-token=... staging
[info] Creating SSH key...
[info] Creating Digital Ocean droplet...
[info] Waiting for SSH...
[info] "staging" has been created and is now the active host. Docker commands will now run against that host.

$ machine ls
NAME      ACTIVE   DRIVER         STATE     URL
dev                virtualbox     Running   tcp://192.168.99.108:2376
staging   *        digitalocean   Running   tcp://104.236.37.134:2376

Machine creates Docker hosts that are secure by default. The connection between the client and daemon is encrypted and authenticated using new identity-based authentication. If you'd like to learn more about this, it is being worked on in a pull request on Docker.

## Try it out

Machine is still in its early stages. If you'd like to try out a preview build, download it here:

You will also need a version of Docker with identity authentication. Builds are available here:

Drivers

VirtualBox

Creates machines locally on VirtualBox. Requires VirtualBox to be installed.

Options:

  • --virtualbox-boot2docker-url: The URL of the boot2docker image. Defaults to the latest available version.
  • --virtualbox-disk-size: Size of disk for the host in MB. Default: 20000
  • --virtualbox-memory: Size of memory for the host in MB. Default: 1024

### Digital Ocean

Creates machines on Digital Ocean. You need to create a personal access token under "Apps & API" in the Digital Ocean Control Panel and pass that to machine create with the --digitalocean-access-token option.

Options:

  • --digitalocean-access-token: Your personal access token for the Digital Ocean API.
  • --digitalocean-image: The name of the Digital Ocean image to use. Default: docker
  • --digitalocean-region: The region to create the droplet in. Default: nyc3
  • --digitalocean-size: The size of the Digital Ocean driver. Default: 512mb
Microsoft Azure

Create machines on Microsoft Azure.

You need to create a subscription with a cert. Run these commands:

$ openssl req -x509 -nodes -days 365 -newkey rsa:1024 -keyout mycert.pem -out mycert.pem
$ openssl pkcs12 -export -out mycert.pfx -in mycert.pem -name "My Certificate"
$ openssl x509 -inform pem -in mycert.pem -outform der -out mycert.cer

Go to the Azure portal, go to the "Settings" page, then "Manage Certificates" and upload mycert.cer.

Grab your subscription ID from the portal, then run machine create with these details:

$ machine create -d azure --azure-subscription-id="SUB_ID" --azure-subscription-cert="mycert.cer"

Options:

  • --azure-subscription-id: Your Azure subscription ID.
  • --azure-subscription-cert: Your Azure subscription cert.

Contributing

Want to hack on Machine? Docker's contributions guidelines apply.

To build, run:

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

Creators

Ben Firshman

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
Godeps
_workspace/src/code.google.com/p/goauth2/oauth
The oauth package provides support for making OAuth2-authenticated HTTP requests.
The oauth package provides support for making OAuth2-authenticated HTTP requests.
_workspace/src/code.google.com/p/goauth2/oauth/example
This program makes a call to the specified API, authenticated with OAuth2.
This program makes a call to the specified API, authenticated with OAuth2.
_workspace/src/code.google.com/p/goauth2/oauth/jwt
The jwt package provides support for creating credentials for OAuth2 service account requests.
The jwt package provides support for creating credentials for OAuth2 service account requests.
_workspace/src/code.google.com/p/goauth2/oauth/jwt/example
This program makes a read only call to the Google Cloud Storage API, authenticated with OAuth2.
This program makes a read only call to the Google Cloud Storage API, authenticated with OAuth2.
_workspace/src/github.com/MSOpenTech/azure-sdk-for-go/core/http
Package http provides HTTP client and server implementations.
Package http provides HTTP client and server implementations.
_workspace/src/github.com/MSOpenTech/azure-sdk-for-go/core/http/cgi
Package cgi implements CGI (Common Gateway Interface) as specified in RFC 3875.
Package cgi implements CGI (Common Gateway Interface) as specified in RFC 3875.
_workspace/src/github.com/MSOpenTech/azure-sdk-for-go/core/http/cookiejar
Package cookiejar implements an in-memory RFC 6265-compliant http.CookieJar.
Package cookiejar implements an in-memory RFC 6265-compliant http.CookieJar.
_workspace/src/github.com/MSOpenTech/azure-sdk-for-go/core/http/fcgi
Package fcgi implements the FastCGI protocol.
Package fcgi implements the FastCGI protocol.
_workspace/src/github.com/MSOpenTech/azure-sdk-for-go/core/http/httptest
Package httptest provides utilities for HTTP testing.
Package httptest provides utilities for HTTP testing.
_workspace/src/github.com/MSOpenTech/azure-sdk-for-go/core/http/httputil
Package httputil provides HTTP utility functions, complementing the more common ones in the net/http package.
Package httputil provides HTTP utility functions, complementing the more common ones in the net/http package.
_workspace/src/github.com/MSOpenTech/azure-sdk-for-go/core/http/pprof
Package pprof serves via its HTTP server runtime profiling data in the format expected by the pprof visualization tool.
Package pprof serves via its HTTP server runtime profiling data in the format expected by the pprof visualization tool.
_workspace/src/github.com/MSOpenTech/azure-sdk-for-go/core/tls
Package tls partially implements TLS 1.2, as specified in RFC 5246.
Package tls partially implements TLS 1.2, as specified in RFC 5246.
_workspace/src/github.com/digitalocean/godo
Package godo is the DigtalOcean API v2 client for Go
Package godo is the DigtalOcean API v2 client for Go
_workspace/src/github.com/docker/docker/pkg/mflag
Package flag implements command-line flag parsing.
Package flag implements command-line flag parsing.
_workspace/src/github.com/docker/docker/pkg/pools
Package pools provides a collection of pools which provide various data types with buffers.
Package pools provides a collection of pools which provide various data types with buffers.
_workspace/src/github.com/docker/libtrust
Package libtrust provides an interface for managing authentication and authorization using public key cryptography.
Package libtrust provides an interface for managing authentication and authorization using public key cryptography.
_workspace/src/github.com/google/go-querystring/query
Package query implements encoding of structs into URL query parameters.
Package query implements encoding of structs into URL query parameters.
_workspace/src/github.com/tent/http-link-go
Package link implements parsing and serialization of Link header values as defined in RFC 5988.
Package link implements parsing and serialization of Link header values as defined in RFC 5988.

Jump to

Keyboard shortcuts

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