Merge pull request #2564 from nathanleclaire/docs_polish

Add docs polish for 0.5.3 release
This commit is contained in:
David Gageot 2015-12-14 08:43:28 +01:00
commit 5ced4fe387
3 changed files with 103 additions and 67 deletions

View File

@ -9,23 +9,29 @@ configures the Docker client to talk to them.
It works a bit like this: It works a bit like this:
```console ```console
$ docker-machine create -d virtualbox dev $ docker-machine create -d virtualbox default
Creating CA: /home/username/.docker/machine/certs/ca.pem Running pre-create checks...
Creating client certificate: /home/username/.docker/machine/certs/cert.pem Creating machine...
Image cache does not exist, creating it at /home/username/.docker/machine/cache... (default) Creating VirtualBox VM...
No default boot2docker iso found locally, downloading the latest release... (default) Creating SSH key...
Downloading https://github.com/boot2docker/boot2docker/releases/download/v1.6.2/boot2docker.iso to /home/username/.docker/machine/cache/boot2docker.iso... (default) Starting VM...
Creating VirtualBox VM... Waiting for machine to be running, this may take a few minutes...
Creating SSH key... Machine is running, waiting for SSH to be available...
Starting VirtualBox VM... Detecting operating system of created instance...
Starting VM... Detecting the provisioner...
To see how to connect Docker to this machine, run: docker-machine env dev Provisioning with boot2docker...
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 Docker to this machine, run: docker-machine env default
$ docker-machine ls $ docker-machine ls
NAME ACTIVE DRIVER STATE URL SWARM NAME ACTIVE DRIVER STATE URL SWARM DOCKER ERRORS
dev * virtualbox Running tcp://192.168.99.127:2376 default - virtualbox Running tcp://192.168.99.188:2376 v1.9.1
$ eval "$(docker-machine env dev)" $ eval "$(docker-machine env default)"
$ docker run busybox echo hello world $ docker run busybox echo hello world
Unable to find image 'busybox:latest' locally Unable to find image 'busybox:latest' locally
@ -34,16 +40,20 @@ df7546f9f060: Pull complete
ea13149945cb: Pull complete ea13149945cb: Pull complete
4986bf8c1536: Pull complete 4986bf8c1536: Pull complete
hello world hello world
```
In addition to local VMs, you can create and manage cloud servers:
```console
$ docker-machine create -d digitalocean --digitalocean-access-token=secret staging $ docker-machine create -d digitalocean --digitalocean-access-token=secret staging
Creating SSH key... Creating SSH key...
Creating Digital Ocean droplet... Creating Digital Ocean droplet...
To see how to connect Docker to this machine, run: docker-machine env staging To see how to connect Docker to this machine, run: docker-machine env staging
$ docker-machine ls $ docker-machine ls
NAME ACTIVE DRIVER STATE URL SWARM NAME ACTIVE DRIVER STATE URL SWARM DOCKER ERRORS
dev - virtualbox Running tcp://192.168.99.127:2376 default - virtualbox Running tcp://192.168.99.188:2376 v1.9.1
staging * digitalocean Running tcp://104.236.253.181:2376 staging - digitalocean Running tcp://45.55.21.28:2376 v1.9.1
``` ```
## Installation and documentation ## Installation and documentation

View File

@ -15,41 +15,48 @@ Let's take a look at using `docker-machine` for creating, using, and managing a
Docker host inside of [VirtualBox](https://www.virtualbox.org/). Docker host inside of [VirtualBox](https://www.virtualbox.org/).
First, ensure that [the latest First, ensure that [the latest
VirtualBox](https://www.virtualbox.org/wiki/Downloads) is correctly installed on VirtualBox](https://www.virtualbox.org/wiki/Downloads) is correctly installed
your system. on your system.
If you run the `docker-machine ls` command to show all available machines, you will see If you run the `docker-machine ls` command to show all available machines, you
that none have been created so far. will see that none have been created so far.
$ docker-machine ls $ docker-machine ls
NAME ACTIVE DRIVER STATE URL NAME ACTIVE DRIVER STATE URL SWARM DOCKER ERRORS
To create one, we run the `docker-machine create` command, passing the string To create one, we run the `docker-machine create` command, passing the string
`virtualbox` to the `--driver` flag. The final argument we pass is the name of `virtualbox` to the `--driver` flag. The final argument we pass is the name of
the machine - in this case, we will name our machine "dev". the machine - in this case, we will name our machine "default".
This command will download a lightweight Linux distribution This command will download a lightweight Linux distribution
([boot2docker](https://github.com/boot2docker/boot2docker)) with the Docker ([boot2docker](https://github.com/boot2docker/boot2docker)) with the Docker
daemon installed, and will create and start a VirtualBox VM with Docker running. daemon installed, and will create and start a VirtualBox VM with Docker
running.
$ docker-machine create --driver virtualbox dev $ docker-machine create --driver virtualbox default
Creating CA: /home/username/.docker/machine/certs/ca.pem Running pre-create checks...
Creating client certificate: /home/username/.docker/machine/certs/cert.pem Creating machine...
Image cache does not exist, creating it at /home/username/.docker/machine/cache... (default) Creating VirtualBox VM...
No default boot2docker iso found locally, downloading the latest release... (default) Creating SSH key...
Downloading https://github.com/boot2docker/boot2docker/releases/download/v1.6.2/boot2docker.iso to /home/username/.docker/machine/cache/boot2docker.iso... (default) Starting VM...
Creating VirtualBox VM... Waiting for machine to be running, this may take a few minutes...
Creating SSH key... Machine is running, waiting for SSH to be available...
Starting VirtualBox VM... Detecting operating system of created instance...
Starting VM... Detecting the provisioner...
To see how to connect Docker to this machine, run: docker-machine env dev Provisioning with boot2docker...
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 Docker to this machine, run: docker-machine env default
You can see the machine you have created by running the `docker-machine ls` You can see the machine you have created by running the `docker-machine ls`
command again: command again:
$ docker-machine ls $ docker-machine ls
NAME ACTIVE DRIVER STATE URL SWARM NAME ACTIVE DRIVER STATE URL SWARM DOCKER ERRORS
dev - virtualbox Running tcp://192.168.99.100:2376 default * virtualbox Running tcp://192.168.99.187:2376 v1.9.1
Next, as noted in the output of the `docker-machine create` command, we have to Next, as noted in the output of the `docker-machine create` command, we have to
tell Docker to talk to that machine. You can do this with the `docker-machine tell Docker to talk to that machine. You can do this with the `docker-machine
@ -63,9 +70,9 @@ env` command. For example,
> see [the `env` command's documentation](reference/env.md) > see [the `env` command's documentation](reference/env.md)
> to learn how to set the environment variables for your shell. > to learn how to set the environment variables for your shell.
This will set environment variables that the Docker client will read which specify This will set environment variables that the Docker client will read which
the TLS settings. Note that you will need to do that every time you open a new tab or specify the TLS settings. Note that you will need to do that every time you
restart your machine. open a new tab or restart your machine.
To see what will be set, run `docker-machine env dev`. To see what will be set, run `docker-machine env dev`.
@ -94,8 +101,8 @@ get using the `docker-machine ip` command:
$ docker-machine ip dev $ docker-machine ip dev
192.168.99.100 192.168.99.100
For instance, you can try running a webserver ([nginx](https://www.nginx.com/) in a For instance, you can try running a webserver ([nginx](https://www.nginx.com/)
container with the following command: in a container with the following command:
$ docker run -d -p 8000:80 nginx $ docker run -d -p 8000:80 nginx
@ -139,23 +146,3 @@ Make sure to specify the machine name as an argument:
$ docker-machine stop dev $ docker-machine stop dev
$ docker-machine start dev $ docker-machine start dev
# Crash Reporting
Provisioning a host is a complex matter that can fail for a lot of reasons.
Your workstation may have a wide variety of shell, network configuration, VPN,
proxy or firewall issues. There are also reasons from the other end of the
chain: your cloud provider or the network in between.
To help `docker-machine` be as stable as possible, we added a monitoring of
crashes whenever you try to `create` or `upgrade` a host. This will send, over
HTTPS, to Bugsnag some information about your `docker-machine` version, build,
OS, ARCH, the path to your current shell and, the history of the last command as
you could see it with a `--debug` option. This data is sent to help us pinpoint
recurring issues with `docker-machine` and will only be transmitted in the case
of a crash of `docker-machine`.
If you wish to opt out of error reporting, you can create a `no-error-report`
file in your `$HOME/.docker/machine` directory, and Docker Machine will disable
this behavior. Leaving the file empty is fine -- Docker Machine just checks for
its presence.

View File

@ -31,23 +31,62 @@ Machine on Linux or for installing Machine alone without Docker Toolbox, see the
## Understand Docker Machine basic concepts ## Understand Docker Machine basic concepts
Docker Machine allows you to provision Docker on virtual machines that reside either on your local system or on a cloud provider. Docker Machine creates a host on a VM and you use the Docker Engine client as needed to build images and create containers on the host. Docker Machine allows you to provision Docker on virtual machines that reside
either on your local system or on a cloud provider. Docker Machine creates a
host on a VM and you use the Docker Engine client as needed to build images and
create containers on the host.
To create a virtual machine, you supply Docker Machine with the name of the driver you want use. The driver represents the virtual environment. For example, on a local Linux, Mac, or Windows system the driver is typically Oracle Virtual Box. For cloud providers, Docker Machine supports drivers such as AWS, Microsoft Azure, Digital Ocean and many more. The Docker Machine reference includes a complete [list of the supported drivers](drivers/index.md). To create a virtual machine, you supply Docker Machine with the name of the
driver you want use. The driver represents the virtual environment. For example,
on a local Linux, Mac, or Windows system the driver is typically Oracle Virtual
Box. For cloud providers, Docker Machine supports drivers such as AWS, Microsoft
Azure, Digital Ocean and many more. The Docker Machine reference includes a
complete [list of the supported drivers](drivers/index.md).
Since Docker runs on Linux, each VM that Docker Machine provisions relies on a base operating system. For convenience, there are default base operating systems. For the Oracle Virtual Box driver, this base operating system is the `boot2docker.iso`. For drivers used to connect to cloud providers, the base operating system is Ubuntu 12.04+. You can change this default when you create a machine. The Docker Machine reference includes a complete [list of the supported operating systems](drivers/os-base.md). Since Docker runs on Linux, each VM that Docker Machine provisions relies on a
base operating system. For convenience, there are default base operating
systems. For the Oracle Virtual Box driver, this base operating system is the
`boot2docker.iso`. For drivers used to connect to cloud providers, the base
operating system is Ubuntu 12.04+. You can change this default when you create a
machine. The Docker Machine reference includes a complete [list of the supported
operating systems](drivers/os-base.md).
For each machine you create, the Docker host address is the IP address of the For each machine you create, the Docker host address is the IP address of the
Linux VM. This address is assigned by the `docker-machine create` subcommand. Linux VM. This address is assigned by the `docker-machine create` subcommand.
You use the `docker-machine ls` command to list the machines you have created. You use the `docker-machine ls` command to list the machines you have created.
The `docker-machine ip <machine-name>` command returns a specific host's IP address. The `docker-machine ip <machine-name>` command returns a specific host's IP
address.
Before you can run a `docker` command on a machine, you configure your Before you can run a `docker` command on a machine, you configure your
command-line to point to that machine. The `docker-machine env <machine-name>` command-line to point to that machine. The `docker-machine env <machine-name>`
subcommand outputs the configuration command you should use. When you run a subcommand outputs the configuration command you should use. When you run a
container on the Docker host, the container's ports map to ports on the VM. container on the Docker host, the container's ports map to ports on the VM.
For a complete list of the `docker-machine` subcommands, see the [Docker Machine subcommand reference](reference/index.md). For a complete list of the `docker-machine` subcommands, see the [Docker Machine
subcommand reference](reference/index.md).
## Crash Reporting
Provisioning a host is a complex matter that can fail for a lot of reasons.
Your workstation may have a wide variety of shell, network configuration, VPN,
proxy or firewall issues. There are also reasons from the other end of the
chain: your cloud provider or the network in between.
To help `docker-machine` be as stable as possible, we added a monitoring of
crashes whenever you try to `create` or `upgrade` a host. This will send, over
HTTPS, to Bugsnag some information about your `docker-machine` version, build,
OS, ARCH, the path to your current shell and, the history of the last command as
you could see it with a `--debug` option. This data is sent to help us pinpoint
recurring issues with `docker-machine` and will only be transmitted in the case
of a crash of `docker-machine`.
If you wish to opt out of error reporting, you can create a `no-error-report`
file in your `$HOME/.docker/machine` directory, and Docker Machine will disable
this behavior. e.g.:
$ mkdir -p ~/.docker/machine && touch ~/.docker/machine/no-error-report
Leaving the file empty is fine -- Docker Machine just checks for its presence.
## Getting help ## Getting help