Merge pull request #343 from joaofnfernandes/machine-reference

Update code blocks in machine/reference
This commit is contained in:
Joao Fernandes 2016-10-25 14:01:27 -07:00 committed by GitHub
commit 9482ecaa40
20 changed files with 513 additions and 405 deletions

View File

@ -13,11 +13,16 @@ title: active
See which machine is "active" (a machine is considered active if the See which machine is "active" (a machine is considered active if the
`DOCKER_HOST` environment variable points to it). `DOCKER_HOST` environment variable points to it).
$ docker-machine ls ```none
NAME ACTIVE DRIVER STATE URL $ docker-machine ls
dev - virtualbox Running tcp://192.168.99.103:2376
staging * digitalocean Running tcp://203.0.113.81:2376 NAME ACTIVE DRIVER STATE URL
$ echo $DOCKER_HOST dev - virtualbox Running tcp://192.168.99.103:2376
tcp://203.0.113.81:2376 staging * digitalocean Running tcp://203.0.113.81:2376
$ docker-machine active
staging $ echo $DOCKER_HOST
tcp://203.0.113.81:2376
$ docker-machine active
staging
```

View File

@ -10,23 +10,26 @@ title: config
# config # config
Usage: docker-machine config [OPTIONS] [arg...] ```none
Usage: docker-machine config [OPTIONS] [arg...]
Print the connection config for machine Print the connection config for machine
Description: Description:
Argument is a machine name. Argument is a machine name.
Options: Options:
--swarm Display the Swarm config instead of the Docker daemon --swarm Display the Swarm config instead of the Docker daemon
```
For example:
For example: ```none
$ docker-machine config dev \
$ docker-machine config dev --tlsverify \
--tlsverify --tlscacert="/Users/ehazlett/.docker/machines/dev/ca.pem" \
--tlscacert="/Users/ehazlett/.docker/machines/dev/ca.pem" --tlscert="/Users/ehazlett/.docker/machines/dev/cert.pem" \
--tlscert="/Users/ehazlett/.docker/machines/dev/cert.pem" --tlskey="/Users/ehazlett/.docker/machines/dev/key.pem" \
--tlskey="/Users/ehazlett/.docker/machines/dev/key.pem" -H tcp://192.168.99.103:2376
-H tcp://192.168.99.103:2376 ```

View File

@ -15,17 +15,19 @@ Create a machine. Requires the `--driver` flag to indicate which provider
(VirtualBox, DigitalOcean, AWS, etc.) the machine should be created on, and an (VirtualBox, DigitalOcean, AWS, etc.) the machine should be created on, and an
argument to indicate the name of the created machine. argument to indicate the name of the created machine.
$ docker-machine create --driver virtualbox dev ```none
Creating CA: /home/username/.docker/machine/certs/ca.pem $ docker-machine create --driver virtualbox dev
Creating client certificate: /home/username/.docker/machine/certs/cert.pem Creating CA: /home/username/.docker/machine/certs/ca.pem
Image cache does not exist, creating it at /home/username/.docker/machine/cache... Creating client certificate: /home/username/.docker/machine/certs/cert.pem
No default boot2docker iso found locally, downloading the latest release... Image cache does not exist, creating it at /home/username/.docker/machine/cache...
Downloading https://github.com/boot2docker/boot2docker/releases/download/v1.6.2/boot2docker.iso to /home/username/.docker/machine/cache/boot2docker.iso... No default boot2docker iso found locally, downloading the latest release...
Creating VirtualBox VM... Downloading https://github.com/boot2docker/boot2docker/releases/download/v1.6.2/boot2docker.iso to /home/username/.docker/machine/cache/boot2docker.iso...
Creating SSH key... Creating VirtualBox VM...
Starting VirtualBox VM... Creating SSH key...
Starting VM... Starting VirtualBox VM...
To see how to connect Docker to this machine, run: docker-machine env dev Starting VM...
To see how to connect Docker to this machine, run: docker-machine env dev
```
## Accessing driver-specific flags in the help text ## Accessing driver-specific flags in the help text
@ -34,33 +36,35 @@ drivers. These largely control aspects of Machine's provisoning process
(including the creation of Docker Swarm containers) that the user may wish to (including the creation of Docker Swarm containers) that the user may wish to
customize. customize.
$ docker-machine create ```none
Docker Machine Version: 0.5.0 (45e3688) $ docker-machine create
Usage: docker-machine create [OPTIONS] [arg...] Docker Machine Version: 0.5.0 (45e3688)
Usage: docker-machine create [OPTIONS] [arg...]
Create a machine. Create a machine.
Run 'docker-machine create --driver name' to include the create flags for that driver in the help text. Run 'docker-machine create --driver name' to include the create flags for that driver in the help text.
Options: Options:
--driver, -d "none" Driver to create machine with. --driver, -d "none" Driver to create machine with.
--engine-install-url "https://get.docker.com" Custom URL to use for engine installation [$MACHINE_DOCKER_INSTALL_URL] --engine-install-url "https://get.docker.com" Custom URL to use for engine installation [$MACHINE_DOCKER_INSTALL_URL]
--engine-opt [--engine-opt option --engine-opt option] Specify arbitrary flags to include with the created engine in the form flag=value --engine-opt [--engine-opt option --engine-opt option] Specify arbitrary flags to include with the created engine in the form flag=value
--engine-insecure-registry [--engine-insecure-registry option --engine-insecure-registry option] Specify insecure registries to allow with the created engine --engine-insecure-registry [--engine-insecure-registry option --engine-insecure-registry option] Specify insecure registries to allow with the created engine
--engine-registry-mirror [--engine-registry-mirror option --engine-registry-mirror option] Specify registry mirrors to use [$ENGINE_REGISTRY_MIRROR] --engine-registry-mirror [--engine-registry-mirror option --engine-registry-mirror option] Specify registry mirrors to use [$ENGINE_REGISTRY_MIRROR]
--engine-label [--engine-label option --engine-label option] Specify labels for the created engine --engine-label [--engine-label option --engine-label option] Specify labels for the created engine
--engine-storage-driver Specify a storage driver to use with the engine --engine-storage-driver Specify a storage driver to use with the engine
--engine-env [--engine-env option --engine-env option] Specify environment variables to set in the engine --engine-env [--engine-env option --engine-env option] Specify environment variables to set in the engine
--swarm Configure Machine with Swarm --swarm Configure Machine with Swarm
--swarm-image "swarm:latest" Specify Docker image to use for Swarm [$MACHINE_SWARM_IMAGE] --swarm-image "swarm:latest" Specify Docker image to use for Swarm [$MACHINE_SWARM_IMAGE]
--swarm-master Configure Machine to be a Swarm master --swarm-master Configure Machine to be a Swarm master
--swarm-discovery Discovery service to use with Swarm --swarm-discovery Discovery service to use with Swarm
--swarm-strategy "spread" Define a default scheduling strategy for Swarm --swarm-strategy "spread" Define a default scheduling strategy for Swarm
--swarm-opt [--swarm-opt option --swarm-opt option] Define arbitrary flags for swarm --swarm-opt [--swarm-opt option --swarm-opt option] Define arbitrary flags for swarm
--swarm-host "tcp://0.0.0.0:3376" ip/socket to listen on for Swarm master --swarm-host "tcp://0.0.0.0:3376" ip/socket to listen on for Swarm master
--swarm-addr addr to advertise for Swarm (default: detect and use the machine IP) --swarm-addr addr to advertise for Swarm (default: detect and use the machine IP)
--swarm-experimental Enable Swarm experimental features --swarm-experimental Enable Swarm experimental features
```
Additionally, drivers can specify flags that Machine can accept as part of their Additionally, drivers can specify flags that Machine can accept as part of their
plugin code. These allow users to customize the provider-specific parameters of plugin code. These allow users to customize the provider-specific parameters of
@ -70,43 +74,45 @@ geographical region (`--amazonec2-region us-west-1`), and so on.
To see the provider-specific flags, simply pass a value for `--driver` when To see the provider-specific flags, simply pass a value for `--driver` when
invoking the `create` help text. invoking the `create` help text.
$ docker-machine create --driver virtualbox --help ```none
Usage: docker-machine create [OPTIONS] [arg...] $ docker-machine create --driver virtualbox --help
Usage: docker-machine create [OPTIONS] [arg...]
Create a machine. Create a machine.
Run 'docker-machine create --driver name' to include the create flags for that driver in the help text. Run 'docker-machine create --driver name' to include the create flags for that driver in the help text.
Options: Options:
--driver, -d "none" Driver to create machine with. --driver, -d "none" Driver to create machine with.
--engine-env [--engine-env option --engine-env option] Specify environment variables to set in the engine --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-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-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-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-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-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 --engine-storage-driver Specify a storage driver to use with the engine
--swarm Configure Machine with Swarm --swarm Configure Machine with Swarm
--swarm-addr addr to advertise for Swarm (default: detect and use the machine IP) --swarm-addr addr to advertise for Swarm (default: detect and use the machine IP)
--swarm-discovery Discovery service to use with Swarm --swarm-discovery Discovery service to use with Swarm
--swarm-experimental Enable Swarm experimental features --swarm-experimental Enable Swarm experimental features
--swarm-host "tcp://0.0.0.0:3376" ip/socket to listen on for Swarm master --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-image "swarm:latest" Specify Docker image to use for Swarm [$MACHINE_SWARM_IMAGE]
--swarm-master Configure Machine to be a Swarm master --swarm-master Configure Machine to be a Swarm master
--swarm-opt [--swarm-opt option --swarm-opt option] Define arbitrary flags for swarm --swarm-opt [--swarm-opt option --swarm-opt option] Define arbitrary flags for swarm
--swarm-strategy "spread" Define a default scheduling strategy for Swarm --swarm-strategy "spread" Define a default scheduling strategy for Swarm
--virtualbox-boot2docker-url The URL of the boot2docker image. Defaults to the latest available version [$VIRTUALBOX_BOOT2DOCKER_URL] --virtualbox-boot2docker-url The URL of the boot2docker image. Defaults to the latest available version [$VIRTUALBOX_BOOT2DOCKER_URL]
--virtualbox-cpu-count "1" number of CPUs for the machine (-1 to use the number of CPUs available) [$VIRTUALBOX_CPU_COUNT] --virtualbox-cpu-count "1" number of CPUs for the machine (-1 to use the number of CPUs available) [$VIRTUALBOX_CPU_COUNT]
--virtualbox-disk-size "20000" Size of disk for host in MB [$VIRTUALBOX_DISK_SIZE] --virtualbox-disk-size "20000" Size of disk for host in MB [$VIRTUALBOX_DISK_SIZE]
--virtualbox-host-dns-resolver Use the host DNS resolver [$VIRTUALBOX_HOST_DNS_RESOLVER] --virtualbox-host-dns-resolver Use the host DNS resolver [$VIRTUALBOX_HOST_DNS_RESOLVER]
--virtualbox-dns-proxy Proxy all DNS requests to the host [$VIRTUALBOX_DNS_PROXY] --virtualbox-dns-proxy Proxy all DNS requests to the host [$VIRTUALBOX_DNS_PROXY]
--virtualbox-hostonly-cidr "192.168.99.1/24" Specify the Host Only CIDR [$VIRTUALBOX_HOSTONLY_CIDR] --virtualbox-hostonly-cidr "192.168.99.1/24" Specify the Host Only CIDR [$VIRTUALBOX_HOSTONLY_CIDR]
--virtualbox-hostonly-nicpromisc "deny" Specify the Host Only Network Adapter Promiscuous Mode [$VIRTUALBOX_HOSTONLY_NIC_PROMISC] --virtualbox-hostonly-nicpromisc "deny" Specify the Host Only Network Adapter Promiscuous Mode [$VIRTUALBOX_HOSTONLY_NIC_PROMISC]
--virtualbox-hostonly-nictype "82540EM" Specify the Host Only Network Adapter Type [$VIRTUALBOX_HOSTONLY_NIC_TYPE] --virtualbox-hostonly-nictype "82540EM" Specify the Host Only Network Adapter Type [$VIRTUALBOX_HOSTONLY_NIC_TYPE]
--virtualbox-import-boot2docker-vm The name of a Boot2Docker VM to import --virtualbox-import-boot2docker-vm The name of a Boot2Docker VM to import
--virtualbox-memory "1024" Size of memory for host in MB [$VIRTUALBOX_MEMORY_SIZE] --virtualbox-memory "1024" Size of memory for host in MB [$VIRTUALBOX_MEMORY_SIZE]
--virtualbox-no-share Disable the mount of your home directory --virtualbox-no-share Disable the mount of your home directory
```
You may notice that some flags specify environment variables that they are You may notice that some flags specify environment variables that they are
associated with as well (located to the far left hand side of the row). If associated with as well (located to the far left hand side of the row). If
@ -137,12 +143,14 @@ filesystem has been created, and so on.
The following is an example usage: The following is an example usage:
$ docker-machine create -d virtualbox \ ```none
--engine-label foo=bar \ $ docker-machine create -d virtualbox \
--engine-label spam=eggs \ --engine-label foo=bar \
--engine-storage-driver overlay \ --engine-label spam=eggs \
--engine-insecure-registry registry.myco.com \ --engine-storage-driver overlay \
foobarmachine --engine-insecure-registry registry.myco.com \
foobarmachine
```
This will create a virtual machine running locally in Virtualbox which uses the This will create a virtual machine running locally in Virtualbox which uses the
`overlay` storage backend, has the key-value pairs `foo=bar` and `spam=eggs` as `overlay` storage backend, has the key-value pairs `foo=bar` and `spam=eggs` as
@ -150,18 +158,20 @@ labels on the engine, and allows pushing / pulling from the insecure registry
located at `registry.myco.com`. You can verify much of this by inspecting the located at `registry.myco.com`. You can verify much of this by inspecting the
output of `docker info`: output of `docker info`:
$ eval $(docker-machine env foobarmachine) ```none
$ docker info $ eval $(docker-machine env foobarmachine)
Containers: 0 $ docker info
Images: 0 Containers: 0
Storage Driver: overlay Images: 0
... Storage Driver: overlay
Name: foobarmachine ...
... Name: foobarmachine
Labels: ...
foo=bar Labels:
spam=eggs foo=bar
provider=virtualbox spam=eggs
provider=virtualbox
```
The supported flags are as follows: The supported flags are as follows:
@ -181,10 +191,12 @@ for all containers, and always use the `syslog` [log
driver](/engine/reference/run.md#logging-drivers-log-driver) you driver](/engine/reference/run.md#logging-drivers-log-driver) you
could run the following create command: could run the following create command:
$ docker-machine create -d virtualbox \ ```none
--engine-opt dns=8.8.8.8 \ $ docker-machine create -d virtualbox \
--engine-opt log-driver=syslog \ --engine-opt dns=8.8.8.8 \
gdns --engine-opt log-driver=syslog \
gdns
```
Additionally, Docker Machine supports a flag, `--engine-env`, which can be used to Additionally, Docker Machine supports a flag, `--engine-env`, which can be used to
specify arbitrary environment variables to be set within the engine with the syntax `--engine-env name=value`. For example, to specify that the engine should use `example.com` as the proxy server, you could run the following create command: specify arbitrary environment variables to be set within the engine with the syntax `--engine-env name=value`. For example, to specify that the engine should use `example.com` as the proxy server, you could run the following create command:
@ -217,13 +229,15 @@ you won't have to worry about it.
Example create: Example create:
$ docker-machine create -d virtualbox \ ```none
--swarm \ $ docker-machine create -d virtualbox \
--swarm-master \ --swarm \
--swarm-discovery token://<token> \ --swarm-master \
--swarm-strategy binpack \ --swarm-discovery token://<token> \
--swarm-opt heartbeat=5 \ --swarm-strategy binpack \
upbeat --swarm-opt heartbeat=5 \
upbeat
```
This will set the swarm scheduling strategy to "binpack" (pack in containers as This will set the swarm scheduling strategy to "binpack" (pack in containers as
tightly as possible per host instead of spreading them out), and the "heartbeat" tightly as possible per host instead of spreading them out), and the "heartbeat"

View File

@ -13,37 +13,41 @@ title: env
Set environment variables to dictate that `docker` should run a command against Set environment variables to dictate that `docker` should run a command against
a particular machine. a particular machine.
$ docker-machine env --help ```none
$ docker-machine env --help
Usage: docker-machine env [OPTIONS] [arg...] Usage: docker-machine env [OPTIONS] [arg...]
Display the commands to set up the environment for the Docker client Display the commands to set up the environment for the Docker client
Description: Description:
Argument is a machine name. Argument is a machine name.
Options: Options:
--swarm Display the Swarm config instead of the Docker daemon --swarm Display the Swarm config instead of the Docker daemon
--shell Force environment to be configured for a specified shell: [fish, cmd, powershell, tcsh], default is sh/bash --shell Force environment to be configured for a specified shell: [fish, cmd, powershell, tcsh], default is sh/bash
--unset, -u Unset variables instead of setting them --unset, -u Unset variables instead of setting them
--no-proxy Add machine IP to NO_PROXY environment variable --no-proxy Add machine IP to NO_PROXY environment variable
```
`docker-machine env machinename` will print out `export` commands which can be `docker-machine env machinename` will print out `export` commands which can be
run in a subshell. Running `docker-machine env -u` will print `unset` commands run in a subshell. Running `docker-machine env -u` will print `unset` commands
which reverse this effect. which reverse this effect.
$ env | grep DOCKER ```none
$ eval "$(docker-machine env dev)" $ env | grep DOCKER
$ env | grep DOCKER $ eval "$(docker-machine env dev)"
DOCKER_HOST=tcp://192.168.99.101:2376 $ env | grep DOCKER
DOCKER_CERT_PATH=/Users/nathanleclaire/.docker/machines/.client DOCKER_HOST=tcp://192.168.99.101:2376
DOCKER_TLS_VERIFY=1 DOCKER_CERT_PATH=/Users/nathanleclaire/.docker/machines/.client
DOCKER_MACHINE_NAME=dev DOCKER_TLS_VERIFY=1
$ # If you run a docker command, now it will run against that host. DOCKER_MACHINE_NAME=dev
$ eval "$(docker-machine env -u)" $ # If you run a docker command, now it will run against that host.
$ env | grep DOCKER $ eval "$(docker-machine env -u)"
$ # The environment variables have been unset. $ env | grep DOCKER
$ # The environment variables have been unset.
```
The output described above is intended for the shells `bash` and `zsh` (if The output described above is intended for the shells `bash` and `zsh` (if
you're not sure which shell you're using, there's a very good possibility that you're not sure which shell you're using, there's a very good possibility that
@ -55,12 +59,14 @@ If you are using `fish` and the `SHELL` environment variable is correctly set to
the path where `fish` is located, `docker-machine env name` will print out the the path where `fish` is located, `docker-machine env name` will print out the
values in the format which `fish` expects: values in the format which `fish` expects:
set -x DOCKER_TLS_VERIFY 1; ```none
set -x DOCKER_CERT_PATH "/Users/nathanleclaire/.docker/machine/machines/overlay"; set -x DOCKER_TLS_VERIFY 1;
set -x DOCKER_HOST tcp://192.168.99.102:2376; set -x DOCKER_CERT_PATH "/Users/nathanleclaire/.docker/machine/machines/overlay";
set -x DOCKER_MACHINE_NAME overlay set -x DOCKER_HOST tcp://192.168.99.102:2376;
# Run this command to configure your shell: set -x DOCKER_MACHINE_NAME overlay
# eval "$(docker-machine env overlay)" # Run this command to configure your shell:
# eval "$(docker-machine env overlay)"
```
If you are on Windows and using either Powershell or `cmd.exe`, `docker-machine env` If you are on Windows and using either Powershell or `cmd.exe`, `docker-machine env`
Docker Machine should now detect your shell automatically. If the automagic detection does not work you Docker Machine should now detect your shell automatically. If the automagic detection does not work you
@ -68,22 +74,26 @@ If you are on Windows and using either Powershell or `cmd.exe`, `docker-machine
For Powershell: For Powershell:
$ docker-machine.exe env --shell powershell dev ```none
$Env:DOCKER_TLS_VERIFY = "1" $ docker-machine.exe env --shell powershell dev
$Env:DOCKER_HOST = "tcp://192.168.99.101:2376" $Env:DOCKER_TLS_VERIFY = "1"
$Env:DOCKER_CERT_PATH = "C:\Users\captain\.docker\machine\machines\dev" $Env:DOCKER_HOST = "tcp://192.168.99.101:2376"
$Env:DOCKER_MACHINE_NAME = "dev" $Env:DOCKER_CERT_PATH = "C:\Users\captain\.docker\machine\machines\dev"
# Run this command to configure your shell: $Env:DOCKER_MACHINE_NAME = "dev"
# docker-machine.exe env --shell=powershell dev | Invoke-Expression # Run this command to configure your shell:
# docker-machine.exe env --shell=powershell dev | Invoke-Expression
```
For `cmd.exe`: For `cmd.exe`:
$ docker-machine.exe env --shell cmd dev ```none
set DOCKER_TLS_VERIFY=1 $ docker-machine.exe env --shell cmd dev
set DOCKER_HOST=tcp://192.168.99.101:2376 set DOCKER_TLS_VERIFY=1
set DOCKER_CERT_PATH=C:\Users\captain\.docker\machine\machines\dev set DOCKER_HOST=tcp://192.168.99.101:2376
set DOCKER_MACHINE_NAME=dev set DOCKER_CERT_PATH=C:\Users\captain\.docker\machine\machines\dev
# Run this command to configure your shell: copy and paste the above values into your command prompt set DOCKER_MACHINE_NAME=dev
# Run this command to configure your shell: copy and paste the above values into your command prompt
```
## Excluding the created machine from proxies ## Excluding the created machine from proxies
@ -95,14 +105,16 @@ This is useful when using `docker-machine` with a local VM provider (e.g.
`virtualbox` or `vmwarefusion`) in network environments where a HTTP proxy is `virtualbox` or `vmwarefusion`) in network environments where a HTTP proxy is
required for internet access. required for internet access.
$ docker-machine env --no-proxy default ```none
export DOCKER_TLS_VERIFY="1" $ docker-machine env --no-proxy default
export DOCKER_HOST="tcp://192.168.99.104:2376" export DOCKER_TLS_VERIFY="1"
export DOCKER_CERT_PATH="/Users/databus23/.docker/machine/certs" export DOCKER_HOST="tcp://192.168.99.104:2376"
export DOCKER_MACHINE_NAME="default" export DOCKER_CERT_PATH="/Users/databus23/.docker/machine/certs"
export NO_PROXY="192.168.99.104" export DOCKER_MACHINE_NAME="default"
# Run this command to configure your shell: export NO_PROXY="192.168.99.104"
# eval "$(docker-machine env default)" # Run this command to configure your shell:
# eval "$(docker-machine env default)"
```
You may also want to visit the [documentation on setting `HTTP_PROXY` for the You may also want to visit the [documentation on setting `HTTP_PROXY` for the
created daemon using the `--engine-env` flag for `docker-machine created daemon using the `--engine-env` flag for `docker-machine

View File

@ -10,22 +10,26 @@ title: help
# help # help
Usage: docker-machine help [arg...] ```none
Usage: docker-machine help [arg...]
Shows a list of commands or help for one command Shows a list of commands or help for one command
```
Usage: docker-machine help _subcommand_ Usage: docker-machine help _subcommand_
For example: For example:
$ docker-machine help config ```none
Usage: docker-machine config [OPTIONS] [arg...] $ docker-machine help config
Usage: docker-machine config [OPTIONS] [arg...]
Print the connection config for machine Print the connection config for machine
Description: Description:
Argument is a machine name. Argument is a machine name.
Options: Options:
--swarm Display the Swarm config instead of the Docker daemon --swarm Display the Swarm config instead of the Docker daemon
```

View File

@ -11,15 +11,17 @@ title: inspect
# inspect # inspect
Usage: docker-machine inspect [OPTIONS] [arg...] ```none
Usage: docker-machine inspect [OPTIONS] [arg...]
Inspect information about a machine Inspect information about a machine
Description: Description:
Argument is a machine name. Argument is a machine name.
Options: Options:
--format, -f Format the output using the given go template. --format, -f Format the output using the given go template.
```
By default, this will render information about a machine as JSON. If a format is By default, this will render information about a machine as JSON. If a format is
specified, the given template will be executed for each result. specified, the given template will be executed for each result.
@ -36,60 +38,63 @@ In addition to the `text/template` syntax, there are some additional functions,
This is the default usage of `inspect`. This is the default usage of `inspect`.
$ docker-machine inspect dev ```none
{ $ docker-machine inspect dev
"DriverName": "virtualbox",
"Driver": { {
"MachineName": "docker-host-128be8d287b2028316c0ad5714b90bcfc11f998056f2f790f7c1f43f3d1e6eda", "DriverName": "virtualbox",
"SSHPort": 55834, "Driver": {
"Memory": 1024, "MachineName": "docker-host-128be8d287b2028316c0ad5714b90bcfc11f998056f2f790f7c1f43f3d1e6eda",
"DiskSize": 20000, "SSHPort": 55834,
"Boot2DockerURL": "", "Memory": 1024,
"IPAddress": "192.168.5.99" "DiskSize": 20000,
}, "Boot2DockerURL": "",
... "IPAddress": "192.168.5.99"
} },
...
}
```
**Get a machine's IP address:** **Get a machine's IP address:**
For the most part, you can pick out any field from the JSON in a fairly For the most part, you can pick out any field from the JSON in a fairly
straightforward manner. straightforward manner.
{% raw %} ```none
$ docker-machine inspect --format='{{.Driver.IPAddress}}' dev $ docker-machine inspect --format='{{.Driver.IPAddress}}' dev
192.168.5.99 192.168.5.99
{% endraw %} ```
**Formatting details:** **Formatting details:**
If you want a subset of information formatted as JSON, you can use the `json` If you want a subset of information formatted as JSON, you can use the `json`
function in the template. function in the template.
{% raw %} ```none
$ docker-machine inspect --format='{{json .Driver}}' dev-fusion $ docker-machine inspect --format='{{json .Driver}}' dev-fusion
{"Boot2DockerURL":"","CPUS":8,"CPUs":8,"CaCertPath":"/Users/hairyhenderson/.docker/machine/certs/ca.pem","DiskSize":20000,"IPAddress":"172.16.62.129","ISO":"/Users/hairyhenderson/.docker/machine/machines/dev-fusion/boot2docker-1.5.0-GH747.iso","MachineName":"dev-fusion","Memory":1024,"PrivateKeyPath":"/Users/hairyhenderson/.docker/machine/certs/ca-key.pem","SSHPort":22,"SSHUser":"docker","SwarmDiscovery":"","SwarmHost":"tcp://0.0.0.0:3376","SwarmMaster":false} {"Boot2DockerURL":"","CPUS":8,"CPUs":8,"CaCertPath":"/Users/hairyhenderson/.docker/machine/certs/ca.pem","DiskSize":20000,"IPAddress":"172.16.62.129","ISO":"/Users/hairyhenderson/.docker/machine/machines/dev-fusion/boot2docker-1.5.0-GH747.iso","MachineName":"dev-fusion","Memory":1024,"PrivateKeyPath":"/Users/hairyhenderson/.docker/machine/certs/ca-key.pem","SSHPort":22,"SSHUser":"docker","SwarmDiscovery":"","SwarmHost":"tcp://0.0.0.0:3376","SwarmMaster":false}
{% endraw %} ```
While this is usable, it's not very human-readable. For this reason, there is While this is usable, it's not very human-readable. For this reason, there is
`prettyjson`: `prettyjson`:
{% raw %} ```
$ docker-machine inspect --format='{{prettyjson .Driver}}' dev-fusion $ docker-machine inspect --format='{{prettyjson .Driver}}' dev-fusion
{ {
"Boot2DockerURL": "", "Boot2DockerURL": "",
"CPUS": 8, "CPUS": 8,
"CPUs": 8, "CPUs": 8,
"CaCertPath": "/Users/hairyhenderson/.docker/machine/certs/ca.pem", "CaCertPath": "/Users/hairyhenderson/.docker/machine/certs/ca.pem",
"DiskSize": 20000, "DiskSize": 20000,
"IPAddress": "172.16.62.129", "IPAddress": "172.16.62.129",
"ISO": "/Users/hairyhenderson/.docker/machine/machines/dev-fusion/boot2docker-1.5.0-GH747.iso", "ISO": "/Users/hairyhenderson/.docker/machine/machines/dev-fusion/boot2docker-1.5.0-GH747.iso",
"MachineName": "dev-fusion", "MachineName": "dev-fusion",
"Memory": 1024, "Memory": 1024,
"PrivateKeyPath": "/Users/hairyhenderson/.docker/machine/certs/ca-key.pem", "PrivateKeyPath": "/Users/hairyhenderson/.docker/machine/certs/ca-key.pem",
"SSHPort": 22, "SSHPort": 22,
"SSHUser": "docker", "SSHUser": "docker",
"SwarmDiscovery": "", "SwarmDiscovery": "",
"SwarmHost": "tcp://0.0.0.0:3376", "SwarmHost": "tcp://0.0.0.0:3376",
"SwarmMaster": false "SwarmMaster": false
} }
{% endraw %} ```

View File

@ -12,8 +12,11 @@ title: ip
Get the IP address of one or more machines. Get the IP address of one or more machines.
$ docker-machine ip dev ```none
192.168.99.104 $ docker-machine ip dev
$ docker-machine ip dev dev2 192.168.99.104
192.168.99.104
192.168.99.105 $ docker-machine ip dev dev2
192.168.99.104
192.168.99.105
```

View File

@ -11,19 +11,23 @@ title: kill
# kill # kill
Usage: docker-machine kill [arg...] ```none
Usage: docker-machine kill [arg...]
Kill (abruptly force stop) a machine Kill (abruptly force stop) a machine
Description: Description:
Argument(s) are one or more machine names. Argument(s) are one or more machine names.
```
For example: For example:
$ docker-machine ls ```none
NAME ACTIVE DRIVER STATE URL $ docker-machine ls
dev * virtualbox Running tcp://192.168.99.104:2376 NAME ACTIVE DRIVER STATE URL
$ docker-machine kill dev dev * virtualbox Running tcp://192.168.99.104:2376
$ docker-machine ls $ docker-machine kill dev
NAME ACTIVE DRIVER STATE URL $ docker-machine ls
dev * virtualbox Stopped NAME ACTIVE DRIVER STATE URL
dev * virtualbox Stopped
```

View File

@ -10,16 +10,18 @@ title: ls
# ls # ls
Usage: docker-machine ls [OPTIONS] [arg...] ```none
Usage: docker-machine ls [OPTIONS] [arg...]
List machines List machines
Options: Options:
--quiet, -q Enable quiet mode --quiet, -q Enable quiet mode
--filter [--filter option --filter option] Filter output based on conditions provided --filter [--filter option --filter option] Filter output based on conditions provided
--timeout, -t "10" Timeout in seconds, default to 10s --timeout, -t "10" Timeout in seconds, default to 10s
--format, -f Pretty-print machines using a Go template --format, -f Pretty-print machines using a Go template
```
## Timeout ## Timeout
@ -31,9 +33,11 @@ the -t flag for this purpose with a numerical value in seconds.
### Example ### Example
$ docker-machine ls -t 12 ```none
NAME ACTIVE DRIVER STATE URL SWARM DOCKER ERRORS $ docker-machine ls -t 12
default - virtualbox Running tcp://192.168.99.100:2376 v1.9.1 NAME ACTIVE DRIVER STATE URL SWARM DOCKER ERRORS
default - virtualbox Running tcp://192.168.99.100:2376 v1.9.1
```
## Filtering ## Filtering
@ -50,25 +54,27 @@ The currently supported filters are:
### Examples ### Examples
$ docker-machine ls ```none
NAME ACTIVE DRIVER STATE URL SWARM DOCKER ERRORS $ docker-machine ls
dev - virtualbox Stopped NAME ACTIVE DRIVER STATE URL SWARM DOCKER ERRORS
foo0 - virtualbox Running tcp://192.168.99.105:2376 v1.9.1 dev - virtualbox Stopped
foo1 - virtualbox Running tcp://192.168.99.106:2376 v1.9.1 foo0 - virtualbox Running tcp://192.168.99.105:2376 v1.9.1
foo2 * virtualbox Running tcp://192.168.99.107:2376 v1.9.1 foo1 - virtualbox Running tcp://192.168.99.106:2376 v1.9.1
foo2 * virtualbox Running tcp://192.168.99.107:2376 v1.9.1
$ docker-machine ls --filter name=foo0 $ docker-machine ls --filter name=foo0
NAME ACTIVE DRIVER STATE URL SWARM DOCKER ERRORS NAME ACTIVE DRIVER STATE URL SWARM DOCKER ERRORS
foo0 - virtualbox Running tcp://192.168.99.105:2376 v1.9.1 foo0 - virtualbox Running tcp://192.168.99.105:2376 v1.9.1
$ docker-machine ls --filter driver=virtualbox --filter state=Stopped $ docker-machine ls --filter driver=virtualbox --filter state=Stopped
NAME ACTIVE DRIVER STATE URL SWARM DOCKER ERRORS NAME ACTIVE DRIVER STATE URL SWARM DOCKER ERRORS
dev - virtualbox Stopped v1.9.1 dev - virtualbox Stopped v1.9.1
$ docker-machine ls --filter label=com.class.app=foo1 --filter label=com.class.app=foo2 $ docker-machine ls --filter label=com.class.app=foo1 --filter label=com.class.app=foo2
NAME ACTIVE DRIVER STATE URL SWARM DOCKER ERRORS NAME ACTIVE DRIVER STATE URL SWARM DOCKER ERRORS
foo1 - virtualbox Running tcp://192.168.99.105:2376 v1.9.1 foo1 - virtualbox Running tcp://192.168.99.105:2376 v1.9.1
foo2 * virtualbox Running tcp://192.168.99.107:2376 v1.9.1 foo2 * virtualbox Running tcp://192.168.99.107:2376 v1.9.1
```
## Formatting ## Formatting
@ -77,7 +83,7 @@ The formatting option (`--format`) will pretty-print machines using a Go templat
Valid placeholders for the Go template are listed below: Valid placeholders for the Go template are listed below:
| Placeholder | Description | | Placeholder | Description |
| -------------- | ---------------------------------------- | |:---------------|:-----------------------------------------|
| .Name | Machine name | | .Name | Machine name |
| .Active | Is the machine active? | | .Active | Is the machine active? |
| .ActiveHost | Is the machine an active non-swarm host? | | .ActiveHost | Is the machine an active non-swarm host? |
@ -96,17 +102,17 @@ when using the table directive, will include column headers as well.
The following example uses a template without headers and outputs the `Name` and `Driver` entries separated by a colon The following example uses a template without headers and outputs the `Name` and `Driver` entries separated by a colon
for all running machines: for all running machines:
{% raw %} ```none
$ docker-machine ls --format "{{.Name}}: {{.DriverName}}" $ docker-machine ls --format "{{.Name}}: {{.DriverName}}"
default: virtualbox default: virtualbox
ec2: amazonec2 ec2: amazonec2
{% endraw %} ```
To list all machine names with their driver in a table format you can use: To list all machine names with their driver in a table format you can use:
{% raw %} ```none
$ docker-machine ls --format "table {{.Name}} {{.DriverName}}" $ docker-machine ls --format "table {{.Name}} {{.DriverName}}"
NAME DRIVER NAME DRIVER
default virtualbox default virtualbox
ec2 amazonec2 ec2 amazonec2
{% endraw %} ```

View File

@ -19,10 +19,13 @@ originally specified Swarm or Engine configuration).
Usage is `docker-machine provision [name]`. Multiple names may be specified. Usage is `docker-machine provision [name]`. Multiple names may be specified.
$ docker-machine provision foo bar ```none
Copying certs to the local machine directory... $ docker-machine provision foo bar
Copying certs to the remote machine...
Setting Docker configuration on the remote daemon... Copying certs to the local machine directory...
Copying certs to the remote machine...
Setting Docker configuration on the remote daemon...
```
The Machine provisioning process will: The Machine provisioning process will:

View File

@ -10,21 +10,26 @@ title: regenerate-certs
# regenerate-certs # regenerate-certs
Usage: docker-machine regenerate-certs [OPTIONS] [arg...] ```none
Usage: docker-machine regenerate-certs [OPTIONS] [arg...]
Regenerate TLS Certificates for a machine Regenerate TLS Certificates for a machine
Description: Description:
Argument(s) are one or more machine names. Argument(s) are one or more machine names.
Options: Options:
--force, -f Force rebuild and do not prompt --force, -f Force rebuild and do not prompt
```
Regenerate TLS certificates and update the machine with new certs. Regenerate TLS certificates and update the machine with new certs.
For example: For example:
$ docker-machine regenerate-certs dev ```none
Regenerate TLS machine certs? Warning: this is irreversible. (y/n): y $ docker-machine regenerate-certs dev
Regenerating TLS certificates
Regenerate TLS machine certs? Warning: this is irreversible. (y/n): y
Regenerating TLS certificates
```

View File

@ -11,16 +11,20 @@ title: restart
# restart # restart
Usage: docker-machine restart [arg...] ```none
Usage: docker-machine restart [arg...]
Restart a machine Restart a machine
Description:
Argument(s) are one or more machine names.
```
Description:
Argument(s) are one or more machine names.
Restart a machine. Oftentimes this is equivalent to Restart a machine. Oftentimes this is equivalent to
`docker-machine stop; docker-machine start`. But some cloud driver try to implement a clever restart which keeps the same `docker-machine stop; docker-machine start`. But some cloud driver try to implement a clever restart which keeps the same
ip address. ip address.
$ docker-machine restart dev ```
Waiting for VM to start... $ docker-machine restart dev
Waiting for VM to start...
```

View File

@ -14,54 +14,58 @@ title: rm
Remove a machine. This will remove the local reference as well as delete it Remove a machine. This will remove the local reference as well as delete it
on the cloud provider or virtualization management platform. on the cloud provider or virtualization management platform.
$ docker-machine rm --help ```none
$ docker-machine rm --help
Usage: docker-machine rm [OPTIONS] [arg...] Usage: docker-machine rm [OPTIONS] [arg...]
Remove a machine Remove a machine
Description: Description:
Argument(s) are one or more machine names. Argument(s) are one or more machine names.
Options: Options:
--force, -f Remove local configuration even if machine cannot be removed, also implies an automatic yes (`-y`) --force, -f Remove local configuration even if machine cannot be removed, also implies an automatic yes (`-y`)
-y Assumes automatic yes to proceed with remove, without prompting further user confirmation -y Assumes automatic yes to proceed with remove, without prompting further user confirmation
```
## Examples ## Examples
$ docker-machine ls ```none
NAME ACTIVE URL STATE URL SWARM DOCKER ERRORS $ docker-machine ls
bar - virtualbox Running tcp://192.168.99.101:2376 v1.9.1 NAME ACTIVE URL STATE URL SWARM DOCKER ERRORS
baz - virtualbox Running tcp://192.168.99.103:2376 v1.9.1 bar - virtualbox Running tcp://192.168.99.101:2376 v1.9.1
foo - virtualbox Running tcp://192.168.99.100:2376 v1.9.1 baz - virtualbox Running tcp://192.168.99.103:2376 v1.9.1
qix - virtualbox Running tcp://192.168.99.102:2376 v1.9.1 foo - virtualbox Running tcp://192.168.99.100:2376 v1.9.1
qix - virtualbox Running tcp://192.168.99.102:2376 v1.9.1
$ docker-machine rm baz $ docker-machine rm baz
About to remove baz About to remove baz
Are you sure? (y/n): y Are you sure? (y/n): y
Successfully removed baz Successfully removed baz
$ docker-machine ls $ docker-machine ls
NAME ACTIVE URL STATE URL SWARM DOCKER ERRORS NAME ACTIVE URL STATE URL SWARM DOCKER ERRORS
bar - virtualbox Running tcp://192.168.99.101:2376 v1.9.1 bar - virtualbox Running tcp://192.168.99.101:2376 v1.9.1
foo - virtualbox Running tcp://192.168.99.100:2376 v1.9.1 foo - virtualbox Running tcp://192.168.99.100:2376 v1.9.1
qix - virtualbox Running tcp://192.168.99.102:2376 v1.9.1 qix - virtualbox Running tcp://192.168.99.102:2376 v1.9.1
$ docker-machine rm bar qix $ docker-machine rm bar qix
About to remove bar, qix About to remove bar, qix
Are you sure? (y/n): y Are you sure? (y/n): y
Successfully removed bar Successfully removed bar
Successfully removed qix Successfully removed qix
$ docker-machine ls $ docker-machine ls
NAME ACTIVE URL STATE URL SWARM DOCKER ERRORS NAME ACTIVE URL STATE URL SWARM DOCKER ERRORS
foo - virtualbox Running tcp://192.168.99.100:2376 v1.9.1 foo - virtualbox Running tcp://192.168.99.100:2376 v1.9.1
$ docker-machine rm -y foo $ docker-machine rm -y foo
About to remove foo About to remove foo
Successfully removed foo Successfully removed foo
```

View File

@ -18,15 +18,17 @@ machine's case, you don't have to specify the name, just the path.
Consider the following example: Consider the following example:
$ cat foo.txt ```none
cat: foo.txt: No such file or directory $ cat foo.txt
$ docker-machine ssh dev pwd cat: foo.txt: No such file or directory
/home/docker $ docker-machine ssh dev pwd
$ docker-machine ssh dev 'echo A file created remotely! >foo.txt' /home/docker
$ docker-machine scp dev:/home/docker/foo.txt . $ docker-machine ssh dev 'echo A file created remotely! >foo.txt'
foo.txt 100% 28 0.0KB/s 00:00 $ docker-machine scp dev:/home/docker/foo.txt .
$ cat foo.txt foo.txt 100% 28 0.0KB/s 00:00
A file created remotely! $ cat foo.txt
A file created remotely!
```
Just like how `scp` has a `-r` flag for copying files recursively, Just like how `scp` has a `-r` flag for copying files recursively,
`docker-machine` has a `-r` flag for this feature. `docker-machine` has a `-r` flag for this feature.

View File

@ -14,45 +14,54 @@ Log into or run a command on a machine using SSH.
To login, just run `docker-machine ssh machinename`: To login, just run `docker-machine ssh machinename`:
$ docker-machine ssh dev ```none
## . $ docker-machine ssh dev
## ## ## == ## .
## ## ## ## === ## ## ## ==
/""""""""""""""""\___/ === ## ## ## ## ===
~~~ {~~ ~~~~ ~~~ ~~~~ ~~ ~ / ===- ~~~ /""""""""""""""""\___/ ===
\______ o __/ ~~~ {~~ ~~~~ ~~~ ~~~~ ~~ ~ / ===- ~~~
\ \ __/ \______ o __/
\____\______/ \ \ __/
_ _ ____ _ _ \____\______/
| |__ ___ ___ | |_|___ \ __| | ___ ___| | _____ _ __ _ _ ____ _ _
| '_ \ / _ \ / _ \| __| __) / _` |/ _ \ / __| |/ / _ \ '__| | |__ ___ ___ | |_|___ \ __| | ___ ___| | _____ _ __
| |_) | (_) | (_) | |_ / __/ (_| | (_) | (__| < __/ | | '_ \ / _ \ / _ \| __| __) / _` |/ _ \ / __| |/ / _ \ '__|
|_.__/ \___/ \___/ \__|_____\__,_|\___/ \___|_|\_\___|_| | |_) | (_) | (_) | |_ / __/ (_| | (_) | (__| < __/ |
Boot2Docker version 1.4.0, build master : 69cf398 - Fri Dec 12 01:39:42 UTC 2014 |_.__/ \___/ \___/ \__|_____\__,_|\___/ \___|_|\_\___|_|
docker@boot2docker:~$ ls / Boot2Docker version 1.4.0, build master : 69cf398 - Fri Dec 12 01:39:42 UTC 2014
Users/ dev/ home/ lib/ mnt/ proc/ run/ sys/ usr/ docker@boot2docker:~$ ls /
bin/ etc/ init linuxrc opt/ root/ sbin/ tmp var/ Users/ dev/ home/ lib/ mnt/ proc/ run/ sys/ usr/
bin/ etc/ init linuxrc opt/ root/ sbin/ tmp var/
```
You can also specify commands to run remotely by appending them directly to the You can also specify commands to run remotely by appending them directly to the
`docker-machine ssh` command, much like the regular `ssh` program works: `docker-machine ssh` command, much like the regular `ssh` program works:
$ docker-machine ssh dev free ```none
total used free shared buffers $ docker-machine ssh dev free
Mem: 1023556 183136 840420 0 30920
-/+ buffers: 152216 871340 total used free shared buffers
Swap: 1212036 0 1212036 Mem: 1023556 183136 840420 0 30920
-/+ buffers: 152216 871340
Swap: 1212036 0 1212036
```
Commands with flags will work as well: Commands with flags will work as well:
$ docker-machine ssh dev df -h ```none
Filesystem Size Used Available Use% Mounted on $ docker-machine ssh dev df -h
rootfs 899.6M 85.9M 813.7M 10% /
tmpfs 899.6M 85.9M 813.7M 10% / Filesystem Size Used Available Use% Mounted on
tmpfs 499.8M 0 499.8M 0% /dev/shm rootfs 899.6M 85.9M 813.7M 10% /
/dev/sda1 18.2G 58.2M 17.2G 0% /mnt/sda1 tmpfs 899.6M 85.9M 813.7M 10% /
cgroup 499.8M 0 499.8M 0% /sys/fs/cgroup tmpfs 499.8M 0 499.8M 0% /dev/shm
/dev/sda1 18.2G 58.2M 17.2G 0% /dev/sda1 18.2G 58.2M 17.2G 0% /mnt/sda1
/mnt/sda1/var/lib/docker/aufs cgroup 499.8M 0 499.8M 0% /sys/fs/cgroup
/dev/sda1 18.2G 58.2M 17.2G 0%
/mnt/sda1/var/lib/docker/aufs
```
If you are using the "external" SSH type as detailed in the next section, you If you are using the "external" SSH type as detailed in the next section, you
can include additional arguments to pass through to the `ssh` binary in the can include additional arguments to pass through to the `ssh` binary in the
@ -61,7 +70,9 @@ the command generated by Docker Machine). For instance, the following command
will forward port 8080 from the `default` machine to `localhost` on your host will forward port 8080 from the `default` machine to `localhost` on your host
computer: computer:
$ docker-machine ssh default -L 8080:localhost:8080 ```bash
$ docker-machine ssh default -L 8080:localhost:8080
```
## Different types of SSH ## Different types of SSH
@ -80,7 +91,9 @@ and Docker Machine will act sensibly out of the box. However, if you
deliberately want to use the Go native version, you can do so with a global deliberately want to use the Go native version, you can do so with a global
command line flag / environment variable like so: command line flag / environment variable like so:
$ docker-machine --native-ssh ssh dev ```bash
$ docker-machine --native-ssh ssh dev
```
There are some variations in behavior between the two methods, so please report There are some variations in behavior between the two methods, so please report
any issues or inconsistencies if you come across them. any issues or inconsistencies if you come across them.

View File

@ -11,14 +11,19 @@ title: start
# start # start
Usage: docker-machine start [arg...] ```none
Usage: docker-machine start [arg...]
Start a machine Start a machine
Description:
Argument(s) are one or more machine names.
```
Description:
Argument(s) are one or more machine names.
For example: For example:
$ docker-machine start dev ```none
Starting VM... $ docker-machine start dev
Starting VM...
```

View File

@ -10,14 +10,18 @@ title: status
# status # status
Usage: docker-machine status [arg...] ```none
Usage: docker-machine status [arg...]
Get the status of a machine Get the status of a machine
Description: Description:
Argument is a machine name. Argument is a machine name.
```
For example: For example:
$ docker-machine status dev ```
Running $ docker-machine status dev
Running
```

View File

@ -11,19 +11,26 @@ title: stop
# stop # stop
Usage: docker-machine stop [arg...] ```none
Usage: docker-machine stop [arg...]
Gracefully Stop a machine Gracefully Stop a machine
Description: Description:
Argument(s) are one or more machine names. Argument(s) are one or more machine names.
```
For example: For example:
$ docker-machine ls ```none
NAME ACTIVE DRIVER STATE URL $ docker-machine ls
dev * virtualbox Running tcp://192.168.99.104:2376
$ docker-machine stop dev NAME ACTIVE DRIVER STATE URL
$ docker-machine ls dev * virtualbox Running tcp://192.168.99.104:2376
NAME ACTIVE DRIVER STATE URL
dev * virtualbox Stopped $ docker-machine stop dev
$ docker-machine ls
NAME ACTIVE DRIVER STATE URL
dev * virtualbox Stopped
```

View File

@ -20,12 +20,15 @@ example, if the machine uses boot2docker for its OS, this command will download
the latest boot2docker ISO and replace the machine's existing ISO with the the latest boot2docker ISO and replace the machine's existing ISO with the
latest. latest.
$ docker-machine upgrade default ```none
Stopping machine to do the upgrade... $ docker-machine upgrade default
Upgrading machine default...
Downloading latest boot2docker release to /home/username/.docker/machine/cache/boot2docker.iso... Stopping machine to do the upgrade...
Starting machine back up... Upgrading machine default...
Waiting for VM to start... Downloading latest boot2docker release to /home/username/.docker/machine/cache/boot2docker.iso...
Starting machine back up...
Waiting for VM to start...
```
> **Note**: If you are using a custom boot2docker ISO specified using > **Note**: If you are using a custom boot2docker ISO specified using
> `--virtualbox-boot2docker-url` or an equivalent flag, running an upgrade on > `--virtualbox-boot2docker-url` or an equivalent flag, running an upgrade on

View File

@ -12,5 +12,7 @@ title: url
Get the URL of a host Get the URL of a host
$ docker-machine url dev ```none
tcp://192.168.99.109:2376 $ docker-machine url dev
tcp://192.168.99.109:2376
```