From 022b18f35022acd10b0b4fa48d0277bdb6f1c2bd Mon Sep 17 00:00:00 2001 From: Dave Henderson Date: Wed, 18 Mar 2015 12:36:58 -0400 Subject: [PATCH 1/3] docs: Normalizing `docker-machine config` references to `docker-machine env` Fixes #762 Signed-off-by: Dave Henderson --- docs/index.md | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/docs/index.md b/docs/index.md index 8570cfd73e..df062453c2 100644 --- a/docs/index.md +++ b/docs/index.md @@ -69,12 +69,13 @@ daemon installed, and will create and start a VirtualBox VM with Docker running. ``` $ docker-machine create --driver virtualbox dev -INFO[0000] Creating SSH key... -INFO[0000] Creating VirtualBox VM... -INFO[0007] Starting VirtualBox VM... -INFO[0007] Waiting for VM to start... -INFO[0038] "dev" has been created and is now the active machine -INFO[0038] To connect: docker $(docker-machine config dev) ps +INFO[0001] Downloading boot2docker.iso to /home/ehazlett/.docker/machine/cache/boot2docker.iso... +INFO[0011] Creating SSH key... +INFO[0012] Creating VirtualBox VM... +INFO[0019] Starting VirtualBox VM... +INFO[0020] Waiting for VM to start... +INFO[0053] "dev" has been created and is now the active machine. +INFO[0053] To point your Docker client at it, run this in your shell: $(docker-machine env dev) ``` To use the Docker CLI, you can use the `env` command to list the commands @@ -83,9 +84,8 @@ needed to connect to the instance. ``` $ docker-machine env dev export DOCKER_TLS_VERIFY=1 -export DOCKER_CERT_PATH=/home/ehazlett/.docker/machines/.client +export DOCKER_CERT_PATH=/home/ehazlett/.docker/machine/machines/dev export DOCKER_HOST=tcp://192.168.99.100:2376 - ``` You can see the machine you have created by running the `docker-machine ls` command @@ -93,27 +93,28 @@ again: ``` $ docker-machine ls -NAME ACTIVE DRIVER STATE URL -dev * virtualbox Running tcp://192.168.99.100:2376 +NAME ACTIVE DRIVER STATE URL SWARM +dev * virtualbox Running tcp://192.168.99.100:2376 ``` The `*` next to `dev` indicates that it is the active host. 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 config` +Docker to talk to that machine. You can do this with the `docker-machine env` command. For example, ``` -$ docker $(docker-machine config dev) ps +$ eval "$(docker-machine env dev)" +$ docker ps ``` -This will pass arguments to the Docker client that specify the TLS settings. -To see what will be passed, run `docker-machine config dev`. +This will set environment variables that the Docker client will read which specify +the TLS settings. To see what will be set, run `docker-machine env dev`. You can now run Docker commands on this host: ``` -$ docker $(docker-machine config dev) run busybox echo hello world +$ docker run busybox echo hello world Unable to find image 'busybox' locally Pulling repository busybox e72ac664f4f0: Download complete @@ -192,7 +193,7 @@ INFO[0000] Creating SSH key... INFO[0000] Creating Digital Ocean droplet... INFO[0002] Waiting for SSH... INFO[0085] "staging" has been created and is now the active machine -INFO[0085] To connect: docker $(docker-machine config dev) staging +INFO[0085] To point your Docker client at it, run this in your shell: $(docker-machine env staging) ``` For convenience, `docker-machine` will use sensible defaults for choosing settings such From 7bcb85f9a9d26b299c2db9143c37da1f08fec425 Mon Sep 17 00:00:00 2001 From: Dave Henderson Date: Thu, 19 Mar 2015 09:44:23 -0400 Subject: [PATCH 2/3] More tweaks - making sure `eval` is mentioned Signed-off-by: Dave Henderson --- docs/index.md | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/docs/index.md b/docs/index.md index df062453c2..0ede536e4f 100644 --- a/docs/index.md +++ b/docs/index.md @@ -75,7 +75,7 @@ INFO[0012] Creating VirtualBox VM... INFO[0019] Starting VirtualBox VM... INFO[0020] Waiting for VM to start... INFO[0053] "dev" has been created and is now the active machine. -INFO[0053] To point your Docker client at it, run this in your shell: $(docker-machine env dev) +INFO[0053] To point your Docker client at it, run this in your shell: eval "$(docker-machine env dev)" ``` To use the Docker CLI, you can use the `env` command to list the commands @@ -84,7 +84,7 @@ needed to connect to the instance. ``` $ docker-machine env dev export DOCKER_TLS_VERIFY=1 -export DOCKER_CERT_PATH=/home/ehazlett/.docker/machine/machines/dev +export DOCKER_CERT_PATH="/home/ehazlett/.docker/machine/machines/dev" export DOCKER_HOST=tcp://192.168.99.100:2376 ``` @@ -193,7 +193,7 @@ INFO[0000] Creating SSH key... INFO[0000] Creating Digital Ocean droplet... INFO[0002] Waiting for SSH... INFO[0085] "staging" has been created and is now the active machine -INFO[0085] To point your Docker client at it, run this in your shell: $(docker-machine env staging) +INFO[0085] To point your Docker client at it, run this in your shell: eval "$(docker-machine env staging)" ``` For convenience, `docker-machine` will use sensible defaults for choosing settings such @@ -256,8 +256,8 @@ custombox * none Running tcp://50.134.234.20:2376 ``` ## Using Docker Machine with Docker Swarm -Docker Machine can also provision [Swarm](https://github.com/docker/swarm) -clusters. This can be used with any driver and will be secured with TLS. +Docker Machine can also provision [Swarm](https://github.com/docker/swarm) +clusters. This can be used with any driver and will be secured with TLS. > **Note**: This is an experimental feature so the subcommands and > options are likely to change in future versions. @@ -320,7 +320,7 @@ For example: ``` $ docker-machine env --swarm swarm-master export DOCKER_TLS_VERIFY=1 -export DOCKER_CERT_PATH=/home/ehazlett/.docker/machines/.client +export DOCKER_CERT_PATH="/home/ehazlett/.docker/machines/.client" export DOCKER_HOST=tcp://192.168.99.100:3376 ``` @@ -363,11 +363,13 @@ Create a machine. ``` $ docker-machine create --driver virtualbox dev +INFO[0001] Downloading boot2docker.iso to /home/ehazlett/.docker/machine/cache/boot2docker.iso... INFO[0000] Creating SSH key... INFO[0000] Creating VirtualBox VM... INFO[0007] Starting VirtualBox VM... INFO[0007] Waiting for VM to start... -INFO[0038] "dev" has been created and is now the active machine. To point Docker at this machine, run: export DOCKER_HOST=$(docker-machine url) DOCKER_AUTH=identity +INFO[0038] "dev" has been created and is now the active machine. +INFO[0038] To point your Docker client at it, run this in your shell: eval "$(docker-machine env dev)" ``` #### config @@ -376,7 +378,7 @@ Show the Docker client configuration for a machine. ``` $ docker-machine config dev ---tls --tlscacert=/Users/ehazlett/.docker/machines/dev/ca.pem --tlscert=/Users/ehazlett/.docker/machines/dev/cert.pem --tlskey=/Users/ehazlett/.docker/machines/dev/key.pem -H tcp://192.168.99.103:2376 +--tls --tlscacert="/Users/ehazlett/.docker/machines/dev/ca.pem" --tlscert="/Users/ehazlett/.docker/machines/dev/cert.pem" --tlskey="/Users/ehazlett/.docker/machines/dev/key.pem" -H tcp://192.168.99.103:2376 ``` #### env From ef37a157fcab517412db2512bd0cc9d9d1f2782c Mon Sep 17 00:00:00 2001 From: Dave Henderson Date: Thu, 19 Mar 2015 09:55:20 -0400 Subject: [PATCH 3/3] --tls is now --tlsverify Signed-off-by: Dave Henderson --- docs/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/index.md b/docs/index.md index 0ede536e4f..6ec9bbfd0a 100644 --- a/docs/index.md +++ b/docs/index.md @@ -378,7 +378,7 @@ Show the Docker client configuration for a machine. ``` $ docker-machine config dev ---tls --tlscacert="/Users/ehazlett/.docker/machines/dev/ca.pem" --tlscert="/Users/ehazlett/.docker/machines/dev/cert.pem" --tlskey="/Users/ehazlett/.docker/machines/dev/key.pem" -H tcp://192.168.99.103:2376 +--tlsverify --tlscacert="/Users/ehazlett/.docker/machines/dev/ca.pem" --tlscert="/Users/ehazlett/.docker/machines/dev/cert.pem" --tlskey="/Users/ehazlett/.docker/machines/dev/key.pem" -H tcp://192.168.99.103:2376 ``` #### env