Skip to content

Commit 29bf571

Browse files
author
vcoisne
authored
Merge pull request docker#89 from ManoMarks/master
Splitting Windows Container Setup
2 parents 8ee2668 + 3eccef4 commit 29bf571

File tree

5 files changed

+136
-102
lines changed

5 files changed

+136
-102
lines changed
+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Setup - AWS
2+
3+
This chapter explores setting up a Windows environment to properly use Windows containers on Amazon Web Services (AWS).
4+
5+
6+
## Windows Server 2016 on AWS
7+
8+
AWS has a pre-baked AMI with Docker Engine already installed. To start an instance, do the following (requires AWS account):
9+
10+
1. Open the [EC2 launch-instance wizard](https://us-west-1.console.aws.amazon.com/ec2/v2/home#LaunchInstanceWizard)
11+
2. Select the "Microsoft Windows Server 2016 Base with Containers" AMI
12+
3. Input setup parameters
13+
- `c4.large` has good performance for development and testing
14+
- The default AWS security group settings will let you connect with Remote Desktop
15+
4. Select "Review and Launch"
16+
5. Once the VM is up, hit "Connect". 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)
17+
6. See details on [getting the initial Windows Administrator password for your AWS instance](https://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/connecting_to_windows_instance.html)
18+
7. Start PowerShell
19+
8. Check that Docker is running with `docker version`
20+
21+
![Connecting to AWS Virtual Machine](images/aws-connect.PNG)
22+
23+
24+
# Next Steps
25+
See the [Microsoft documentation for more comprehensive instructions](https://msdn.microsoft.com/virtualization/windowscontainers/containers_welcome "Microsoft documentation").
26+
27+
Continue to Step 2: [Getting Started with Windows Containers](WindowsContainers.md "Getting Started with Windows Containers")
+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Setup - Azure
2+
3+
This chapter explores setting up a Windows environment to properly use Windows containers on Microsoft Azure.
4+
5+
6+
## Windows Server 2016 on Azure
7+
8+
Microsoft Azure has a pre-baked VM image with Docker engine and base images pre-loaded. To get started (requires Azure account):
9+
10+
1. Create a [Windows Server 2016 Datacenter - with Containers](https://azure.microsoft.com/en-us/marketplace/partners/microsoft/windowsserver2016datacenterwithcontainers/) VM. This VM image has Docker pre-installed and the Windows base layers pre-loaded.
11+
2. Select "Classic" deployment model and hit "Create"
12+
3. Input setup parameters
13+
- Default settings are good
14+
- Creating a new resource group is fine
15+
- `DS2_V2` instance type has good performance for development and testing
16+
4. Check the Summary and hit "OK". Setup will take a couple of minutes
17+
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)
18+
6. Login with the username and password configured during setup
19+
7. Start PowerShell
20+
8. `Start-Service docker`
21+
9. Check that Docker is running with `docker version`
22+
23+
![Creating Azure Virtual Machine](images/Azure-ws2016-Create-Virtual-Machine.PNG)
24+
25+
![Connecting to Azure Virtual Machine](images/Azure-ws2016-Connect.PNG)
26+
27+
# Next Steps
28+
See the [Microsoft documentation for more comprehensive instructions](https://msdn.microsoft.com/virtualization/windowscontainers/containers_welcome "Microsoft documentation").
29+
30+
Continue to Step 2: [Getting Started with Windows Containers](WindowsContainers.md "Getting Started with Windows Containers")
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# Setup - Windows Server 2016
2+
3+
This chapter explores setting up a Windows environment to properly use Windows containers on Windows Server 2016, on bare metal or in VM.
4+
5+
## Windows Server 2016 on bare metal or in VM
6+
7+
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.
8+
9+
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.
10+
11+
### PowerShell Package Provider (recommended)
12+
13+
Microsoft maintains a [PowerShell package provider](https://www.powershellgallery.com/packages/DockerMsftProvider) that lets easily install Docker on Windows Server 2016.
14+
15+
Run the following in an Administrative PowerShell prompt:
16+
17+
```
18+
Install-Module -Name DockerMsftProvider -Force
19+
Install-Package -Name docker -ProviderName DockerMsftProvider -Force
20+
Restart-Computer -Force
21+
```
22+
23+
### PowerShell Desired State Configuration
24+
25+
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).
26+
27+
Here's how to use it:
28+
29+
```
30+
Install-Script -Name Install-DockerOnWS2016UsingDSC
31+
Install-DockerOnWS2016UsingDSC.ps1
32+
```
33+
34+
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/).
35+
36+
Whether using the PowerShell Package Provider or DSC, Docker Engine is now running as a Windows service, listening on the default Docker named pipe.
37+
38+
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:
39+
40+
# Open firewall port 2375
41+
netsh advfirewall firewall add rule name="docker engine" dir=in action=allow protocol=TCP localport=2375
42+
43+
# Configure Docker daemon to listen on both pipe and TCP (replaces docker --register-service invocation above)
44+
Stop-Service docker
45+
dockerd --unregister-service
46+
dockerd -H npipe:// -H 0.0.0.0:2375 --register-service
47+
Start-Service docker
48+
49+
The Windows Server 2016 Docker engine can now be used from the VM host by setting `DOCKER_HOST`:
50+
`$env:DOCKER_HOST = "<ip-address-of-vm>:2375"`
51+
52+
# Next Steps
53+
See the [Microsoft documentation for more comprehensive instructions](https://msdn.microsoft.com/virtualization/windowscontainers/containers_welcome "Microsoft documentation").
54+
55+
Continue to Step 2: [Getting Started with Windows Containers](WindowsContainers.md "Getting Started with Windows Containers")
+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Setup - Windows 10
2+
3+
This chapter explores setting up a Windows environment to properly use Windows containers on Windows 10.
4+
5+
## Windows 10 with Anniversary Update
6+
7+
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.
8+
9+
The simplest way to get a Windows Docker Engine is by installing the [Docker for Windows](https://docs.docker.com/docker-for-windows/ "Docker for Windows") public beta ([direct download link](https://download.docker.com/win/beta/InstallDocker.msi)). Docker for Windows used to only setup a Linux-based Docker development environment, but the public beta version now sets up both Linux and Windows Docker development environments, and we’re working on improving Windows container support and Linux/Windows container interoperability.
10+
11+
With the public beta installed, the Docker for Windows tray icon has an option to switch between Linux and Windows container development.
12+
13+
![Image of switching between Linux and Windows development environments](images/docker-for-windows-switch.gif "Image of switching between Linux and Windows development environments")
14+
15+
# Next Steps
16+
See the [Microsoft documentation for more comprehensive instructions](https://msdn.microsoft.com/virtualization/windowscontainers/containers_welcome "Microsoft documentation").
17+
18+
Continue to Step 2: [Getting Started with Windows Containers](WindowsContainers.md "Getting Started with Windows Containers")

windows/windows-containers/Setup.md

+6-102
Original file line numberDiff line numberDiff line change
@@ -1,109 +1,13 @@
11
# Setup
22

3-
This chapter explores setting up a Windows environment to properly use Windows containers. There are three options for running Windows containers:
3+
There are four environments you can use to set-up Windows Containers. We have provided separate guides for each:
44

5-
+ Windows 10 with the Anniversary Update
6-
+ Windows Server 2016 on Azure
7-
+ Windows Server 2016 on bare metal or in VM
8-
9-
## Windows 10 with Anniversary Update
10-
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.
12-
13-
The simplest way to get a Windows Docker Engine is by installing the [Docker for Windows](https://docs.docker.com/docker-for-windows/ "Docker for Windows") public beta ([direct download link](https://download.docker.com/win/beta/InstallDocker.msi)). Docker for Windows used to only setup a Linux-based Docker development environment, but the public beta version now sets up both Linux and Windows Docker development environments, and we’re working on improving Windows container support and Linux/Windows container interoperability.
14-
15-
With the public beta installed, the Docker for Windows tray icon has an option to switch between Linux and Windows container development.
16-
17-
![Image of switching between Linux and Windows development environments](images/docker-for-windows-switch.gif "Image of switching between Linux and Windows development environments")
18-
19-
Switch to Windows containers and skip the next sections.
20-
21-
## Windows Server 2016 on Azure
22-
23-
Microsoft Azure has a pre-baked VM image with Docker engine and base images pre-loaded. To get started (requires Azure account):
24-
25-
1. Create a [Windows Server 2016 Datacenter - with Containers](https://azure.microsoft.com/en-us/marketplace/partners/microsoft/windowsserver2016datacenterwithcontainers/) VM. 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
28-
- Default settings are good
29-
- Creating a new resource group is fine
30-
- `DS2_V2` instance type has good performance for development and testing
31-
4. Check the Summary and hit "OK". Setup will take a couple of minutes
32-
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)
33-
6. Login with the username and password configured during setup
34-
7. Start PowerShell
35-
8. `Start-Service docker`
36-
9. Check that Docker is running with `docker version`
37-
38-
![Creating Azure Virtual Machine](images/Azure-ws2016-Create-Virtual-Machine.PNG)
39-
40-
![Connecting to Azure Virtual Machine](images/Azure-ws2016-Connect.PNG)
41-
42-
## Windows Server 2016 on AWS
43-
44-
AWS has a pre-baked AMI with Docker Engine already installed. To start an instance, do the following (requires AWS account):
45-
46-
1. Open the [EC2 launch-instance wizard](https://us-west-1.console.aws.amazon.com/ec2/v2/home#LaunchInstanceWizard)
47-
2. Select the "Microsoft Windows Server 2016 Base with Containers" AMI
48-
3. Input setup parameters
49-
- `c4.large` has good performance for development and testing
50-
- The default AWS security group settings will let you connect with Remote Desktop
51-
4. Select "Review and Launch"
52-
5. Once the VM is up, hit "Connect". 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)
53-
6. See details on [getting the initial Windows Administrator password for your AWS instance](https://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/connecting_to_windows_instance.html)
54-
7. Start PowerShell
55-
8. Check that Docker is running with `docker version`
56-
57-
![Connecting to AWS Virtual Machine](images/aws-connect.PNG)
58-
59-
## Windows Server 2016 on bare metal or in VM
60-
61-
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.
62-
63-
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.
64-
65-
### PowerShell Package Provider (recommended)
66-
67-
Microsoft maintains a [PowerShell package provider](https://www.powershellgallery.com/packages/DockerMsftProvider) that lets easily install Docker on Windows Server 2016.
68-
69-
Run the following in an Administrative PowerShell prompt:
70-
71-
```
72-
Install-Module -Name DockerMsftProvider -Force
73-
Install-Package -Name docker -ProviderName DockerMsftProvider -Force
74-
Restart-Computer -Force
75-
```
76-
77-
### PowerShell Desired State Configuration
78-
79-
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).
80-
81-
Here's how to use it:
82-
83-
```
84-
Install-Script -Name Install-DockerOnWS2016UsingDSC
85-
Install-DockerOnWS2016UsingDSC.ps1
86-
```
87-
88-
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/).
89-
90-
Whether using the PowerShell Package Provider or DSC, Docker Engine is now running as a Windows service, listening on the default Docker named pipe.
91-
92-
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:
93-
94-
# Open firewall port 2375
95-
netsh advfirewall firewall add rule name="docker engine" dir=in action=allow protocol=TCP localport=2375
96-
97-
# Configure Docker daemon to listen on both pipe and TCP (replaces docker --register-service invocation above)
98-
Stop-Service docker
99-
dockerd --unregister-service
100-
dockerd -H npipe:// -H 0.0.0.0:2375 --register-service
101-
Start-Service docker
102-
103-
The Windows Server 2016 Docker engine can now be used from the VM host by setting `DOCKER_HOST`:
104-
`$env:DOCKER_HOST = "<ip-address-of-vm>:2375"`
5+
+ [Windows 10 with the Anniversary Update](Setup-Win10.md "Windows 10 Setup")
6+
+ [Windows Server 2016 on Azure](Setup-Azure.md "MS Azure Setup")
7+
+ [Windows Server 2016 on AWS](Setup-AWS.md "AWS Setup")
8+
+ [Windows Server 2016 on bare metal or in VM](Setup-Server2016.md "Setup on Windows 2016")
1059

10610
# Next Steps
10711
See the [Microsoft documentation for more comprehensive instructions](https://msdn.microsoft.com/virtualization/windowscontainers/containers_welcome "Microsoft documentation").
10812

109-
Continue to Step 2: [Getting Started with Windows Containers](WindowsContainers.md "Getting Started with Windows Containers")
13+
After you have completed setup, you can continue to Step 2: [Getting Started with Windows Containers](WindowsContainers.md "Getting Started with Windows Containers")

0 commit comments

Comments
 (0)