You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This chapter explores setting up your Windows environment to properly use Windows containers. You have two choices for environment at this point.
1
+
# Setup
2
+
3
+
This chapter explores setting up a Windows environment to properly use Windows containers. There are three options for running Windows containers:
3
4
4
5
+ Windows 10 with the Anniversary Update
5
-
+ Windows Server 2016
6
+
+ Windows Server 2016 on Azure
7
+
+ Windows Server 2016 on bare metal or in VM
6
8
7
-
###Windows 10 with Anniversary Update
9
+
## Windows 10 with Anniversary Update
8
10
9
11
For developers, Windows 10 is a great place to run Docker Windows containers and containerization support was added to the the Windows 10 kernel with the [Anniversary Update](https://blogs.windows.com/windowsexperience/2016/08/02/how-to-get-the-windows-10-anniversary-update/) (note that container images can only be based on Windows Server Core and Nanoserver, not Windows 10). All that’s missing is the Windows-native Docker Engine and some image base layers.
10
12
@@ -14,50 +16,74 @@ With the public beta installed, the Docker for Windows tray icon has an option t
14
16
15
17

16
18
17
-
Switch to Windows containers and skip the next section.
19
+
Switch to Windows containers and skip the next sections.
18
20
21
+
## Windows Server 2016 on Azure
19
22
20
-
### Windows Server 2016
23
+
It's very easy to setup a fully configured Microsoft Azure VM with Docker Engine running, and base images pre-loaded:
21
24
22
-
Windows Server 2016 is the where Docker Windows containers should be deployed for production. For developers planning to do lots of Docker Windows container development, it may also be worth setting up a Windows Server 2016 dev system (in a VM, for example), at least until Windows 10 and Docker for Windows support for Windows containers matures. Running a VM with Windows Server 2016 is also a great way to do Docker Windows container development on macOS and older Windows versions.
25
+
1. Create a [Windows Server 2016 Datacenter - with Containers VM](https://azure.microsoft.com/en-us/marketplace/partners/microsoft/windowsserver2016datacenterwithcontainers/). This VM image has Docker pre-installed and the Windows base layers pre-loaded.
26
+
2. Select "Classic" deployment model and hit "Create"
27
+
3. Input setup parameters. Default settings are good
28
+
4. Check the Summary and hit "OK". Setup will take a couple of minutes
29
+
5. Once the VM is running, select "Connect" to open a remote desktop connection. If using macOS, get the free [Remote Desktop app in the Mac App Store](https://itunes.apple.com/us/app/microsoft-remote-desktop/id715768417?mt=12).
30
+
6. Login with the username and password configured during setup
31
+
7. Start PowerShell
32
+
8.`Start-Service docker`
33
+
9. Check that Docker is running with `docker version`
23
34
24
-
Once Windows Server 2016 is running, log in, run Windows Update to ensure you have all the latest updates and install the Windows-native Docker Engine directly (that is, not using “Docker for Windows”). You have two options for that:
GitHub user @PlagueHQ has set-up a [Powershell script](https://www.powershellgallery.com/packages/Install-DockerOnWS2016UsingDSC/1.0.1/DisplayScript"DockerOnWS2016UsingDSC Script") in the Powershell Gallery. You can run it in two steps:
37
+

Windows Server 2016 is where Docker Windows containers should be deployed for production. For developers planning to do lots of Docker Windows container development, it may also be worth setting up a Windows Server 2016 dev system (in a VM, for example), at least until Windows 10 and Docker for Windows support for Windows containers matures. Running a VM with Windows Server 2016 is also a great way to do Docker Windows container development on macOS and older Windows versions.
42
+
43
+
Once Windows Server 2016 is running, log in, run Windows Update (use `sconfig` on Windows Server Core) to ensure all the latest updates are installed and install the Windows-native Docker Engine (that is, don't use "Docker for Windows"). There are two options: Install using a Powershell Package (recommended) or with DSC.
44
+
45
+
### PowerShell Package Provider (recommended)
46
+
47
+
Microsoft maintains a [PowerShell package provider](https://www.powershellgallery.com/packages/DockerMsftProvider) that lets easily install Docker on Windows Server 2016.
33
48
34
-
#### Option 2
35
-
To run it in a more manual fashion, you can install it using NuGet. Run the following in an Administrative PowerShell prompt:
49
+
Run the following in an Administrative PowerShell prompt:
Docker Engine is now running as a Windows service, listening on the default Docker named pipe. For development VMs running (for example) in a Hyper-V VM on Windows 10, it might be advantageous to make the Docker Engine running in the Windows Server 2016 VM available to the Windows 10 host:
57
+
### PowerShell Desired State Configuration
58
+
59
+
If interested in experimenting with [Windows PowerShell Desired State Configuration](https://msdn.microsoft.com/en-us/powershell/dsc/overview), Daniel Scott-Raynsford has built a [prototype script that uses DSC to install Docker Engine](https://www.powershellgallery.com/packages/Install-DockerOnWS2016UsingDSC/1.0.1/DisplayScript).
See Daniel's blog post for [details on installing Docker with DCS](https://dscottraynsford.wordpress.com/2016/10/15/install-docker-on-windows-server-2016-using-dsc/).
69
+
70
+
Whether using the PowerShell Package Provider or DSC, Docker Engine is now running as a Windows service, listening on the default Docker named pipe.
71
+
72
+
For development VMs running (for example) in a Hyper-V VM on Windows 10, it might be advantageous to make the Docker Engine running in the Windows Server 2016 VM available to the Windows 10 host:
The Windows Server 2016 Docker engine can now be used from the VM host by setting `DOCKER_HOST`:
58
84
`$env:DOCKER_HOST = "<ip-address-of-vm>:2375"`
59
85
60
-
##Next Steps
86
+
# Next Steps
61
87
See the [Microsoft documentation for more comprehensive instructions](https://msdn.microsoft.com/virtualization/windowscontainers/containers_welcome"Microsoft documentation").
62
88
63
89
Continue to Step 2: [Getting Started with Windows Containers](WindowsContainers.md"Getting Started with Windows Containers")
0 commit comments