From 7aaf72119dba8b42fddbec067d86cffa956f93fd Mon Sep 17 00:00:00 2001 From: Victoria Bialas Date: Thu, 23 Feb 2017 17:48:22 -0800 Subject: [PATCH] updated swarm and voting app tutorials per d4mac, d4win, toolbox and driver issues Signed-off-by: Victoria Bialas --- engine/getstarted-voting-app/cleanup.md | 2 +- engine/getstarted-voting-app/index.md | 24 ++++----- engine/getstarted-voting-app/node-setup.md | 63 +++++++++++++++------- engine/swarm/swarm-tutorial/index.md | 14 +---- machine/drivers/hyper-v.md | 1 + 5 files changed, 58 insertions(+), 46 deletions(-) diff --git a/engine/getstarted-voting-app/cleanup.md b/engine/getstarted-voting-app/cleanup.md index 719a40f567..c11b0f58c7 100644 --- a/engine/getstarted-voting-app/cleanup.md +++ b/engine/getstarted-voting-app/cleanup.md @@ -19,7 +19,7 @@ To shut down the voting app, simply stop the machines on which it is running. If manager - virtualbox Running tcp://192.168.99.100:2376 v1.13.1 worker - virtualbox Running tcp://192.168.99.101:2376 v1.13.1 ``` -2. Use `docker-machine stop` to stop each machine, beginning with the worker. +2. Use `docker-machine stop` to shut down each machine, beginning with the worker. ``` $ docker-machine stop worker diff --git a/engine/getstarted-voting-app/index.md b/engine/getstarted-voting-app/index.md index 3edd78b535..cfdddafe13 100644 --- a/engine/getstarted-voting-app/index.md +++ b/engine/getstarted-voting-app/index.md @@ -17,21 +17,17 @@ Docker Engine. ## Got Docker? -If you haven't yet downloaded Docker or installed it, go to -[Get Docker](/engine/getstarted/step_one.md#step-1-get-docker) -and grab Docker for your platform. You can follow along and -run this example using Docker for Mac, Docker for Windows or -Docker for Linux. +If you haven't yet downloaded Docker or installed it, go to [Get +Docker](/engine/getstarted/step_one.md#step-1-get-docker) and grab Docker for +your platform. You can follow along and run this example using Docker for Mac, +Docker for Windows or Docker for Linux. -Once you have Docker installed, you can run `docker run hello-world` -or other commands described in the Get Started with Docker -tutorial to [verify your installation](/engine/getstarted/step_one.md#step-3-verify-your-installation). -If you are totally new to Docker, you might continue through -the full [Get Started with Docker tutorial](/engine/getstarted/index.md) -first, then come back. - ->**Note:** If you are using Docker for Windows, you will not be able to -follow the [machine setup](node-setup.md) part of this tutorial because it describes a legacy driver that is incompatible with Docker for Windows. However, you can use a cloud setup instead, as described in the relevant steps. +Once you have Docker installed, you can run `docker run hello-world` or other +commands described in the Get Started with Docker tutorial to [verify your +installation](/engine/getstarted/step_one.md#step-3-verify-your-installation). +If you are totally new to Docker, you might continue through the full [Get +Started with Docker tutorial](/engine/getstarted/index.md) first, then come +back. ## What you'll learn and do diff --git a/engine/getstarted-voting-app/node-setup.md b/engine/getstarted-voting-app/node-setup.md index 52c7e47145..d3c3a81af9 100644 --- a/engine/getstarted-voting-app/node-setup.md +++ b/engine/getstarted-voting-app/node-setup.md @@ -9,35 +9,62 @@ for the swarm nodes. You could create these Docker hosts on different physical machines, virtual machines, or cloud providers. For this example, we use [Docker Machine](/machine/get-started.md) to create two -virtual machines on a single system. (See [Docker Machine -Overview](/machine/overview.md) to learn more.) We'll also verify the setup, and +virtual machines on a single system. We'll also verify the setup, and run some basic commmands to interact with the machines. ->**Note:** If you are using Docker for Windows, you will not be able to -follow along with this machine setup part of the tutorial because it describes -using the Docker Machine legacy `virtualbox` driver, which is not compatible -with Docker for Windows Hyper-V. (See [What to know before you -install](/docker-for-windows/install.md#what-to-know-before-you-install)). -However, you can set up your Dockerized machines in the cloud, and follow -the rest of the steps to create a swarm and deploy this sample app. You can use -[Docker Cloud](/docker-cloud/index.md) or [use Docker Machine to -provision hosts on your cloud provider](/machine/get-started-cloud.md). Once you have your cloud machines set up, skip directly to the next step, where we [create a swarm](create-swarm.md) across the two nodes. +## Prerequisites + +* **Docker Machine** - These steps rely on use of +[Docker Machine](/machine/get-started.md) (`docker-machine`), which +comes auto-installed with both Docker for Mac and Docker for Windows. + +* **VirtualBox driver on Docker for Mac** - On Docker for Mac, you'll use `docker-machine` with +the `virtualbox` driver to create machines. If you had a legacy installation +of Docker Toolbox, you already have Oracle VirtualBox installed as part of +that. If you started fresh with Docker for Mac, then you need to install +VirtualBox independently. We recommend doing this rather than using the Toolbox +installer because it can [conflict](/docker-for-mac/docker-toolbox.md) with +Docker for Mac. You can [download VirtualBox +here](https://www.virtualbox.org/wiki/Downloads). Click the link for `OS X +hosts`, click the `.dmg` intaller, and follow the instructions to install. You +do not need to start it, as we are simply using the driver. + +* **Hyper-V driver on Docker for Windows** - On Docker for Windows, you +will use `docker-machine` with the [`Hyper-V`](/machine/drivers/hyper-v/) driver +to create machines. You will need to follow the instructions in the [Hyper-V +example](/machine/drivers/hyper-v#example) reference topic to set up a new +external network switch (a one-time task), reboot, and then +[create the machines (nodes)](/machine/drivers/hyper-v.md#create-the-nodes-with-docker-machine-and-the-microsoft-hyper-v-driver) +in an elevated PowerShell per those instructions. + +### Commands to create machines + +The Docker Machine commands to create local virtual machines on Mac and Windows are are as follows. The rest of the `docker-machine` commands are the same on both. + +#### Mac + +``` +docker-machine create --driver virtualbox HOST-NAME +``` + +#### Windows + +``` +docker-machine create -d hyperv --hyperv-virtual-switch "NETWORK-SWITCH" +MACHINE-NAME` +``` + +This must be done in an elevated PowerShell, using a custom-created external network switch. See [Hyper-V example](/machine/drivers/hyper-v#example). ## Create manager and worker machines -The Docker Machine command to create a local virtual machine is: - -``` -docker-machine create --driver virtualbox -``` - Create two machines and name them to anticipate what their roles will be in the swarm: * manager * worker -Here is an example of creating the `manager`. Create this one, then do the same for `worker`. +Here is an example of creating the `manager` on Docker for Mac. Create this one, then do the same for `worker`. ``` $ docker-machine create --driver virtualbox manager diff --git a/engine/swarm/swarm-tutorial/index.md b/engine/swarm/swarm-tutorial/index.md index 90c0fd7536..b5c70e2922 100644 --- a/engine/swarm/swarm-tutorial/index.md +++ b/engine/swarm/swarm-tutorial/index.md @@ -67,7 +67,7 @@ single-node and multi-node swarm scenarios on Linux machines. #### Use Docker for Mac or Docker for Windows Alternatively, install the latest [Docker for Mac](/docker-for-mac/index.md) or -[Docker for Windows](/docker-for-windows/index.md) application on a one +[Docker for Windows](/docker-for-windows/index.md) application on one computer. You can test both single-node and multi-node swarm from this computer, but you will need to use Docker Machine to test the multi-node scenarios. @@ -88,18 +88,6 @@ or `worker2` in our example). After you create the nodes, you can run all swarm commands as shown from the Mac terminal or Windows PowerShell with Docker for Mac or Docker for Windows running. - ->**Note:** If you are using Docker for Windows, you will not be able to -use Docker Machine to create nodes locally because that worklfow relies on using -a legacy `virtualbox` driver, which is not compatible with Docker for Windows. -(See [What to know before you -install](/docker-for-windows/install.md#what-to-know-before-you-install)). -However, if you set up your Dockerized instances in the cloud, you can follow -the rest of the steps to create a swarm and deploy this sample app. There are a -few ways to do this. You can use [Docker Cloud](/docker-cloud/index.md) or you -can [use Docker Machine to provision hosts on your cloud -provider](/machine/get-started-cloud.md). - ### The IP address of the manager machine The IP address must be assigned to a network interface available to the host diff --git a/machine/drivers/hyper-v.md b/machine/drivers/hyper-v.md index 3dcdc090cb..fa6c31223d 100644 --- a/machine/drivers/hyper-v.md +++ b/machine/drivers/hyper-v.md @@ -2,6 +2,7 @@ description: Microsoft Hyper-V driver for machine keywords: machine, Microsoft Hyper-V, driver title: Microsoft Hyper-V +toc_max: 4 --- Creates a Boot2Docker virtual machine locally on your Windows machine