@JohnKoepi backend system engineer

Docker Windows install instructions on the state of 4 August 2016

Configuration of Windows 10 / Windows Server 2016 TP5 requires few specific steps to be done in order to make Docker work. This is detailed description of the setup sequence.

Another Solution

Prepared Windows Server 2016 TP5 with everything on-board image can be build with Packer using @StefanScherer's github.com/docker-windows-box. Its possible to build VirtualBox, VMWare or Hyper-V image. Configuration scripts sits in https://github.com/StefanScherer/docker-windows-box/tree/master/scripts.

Step-by-step guide

  1. Hyper-V setup: In order to connect the VM to the internet configure: External virtual switch in Shared control mode. There is also an opportunity to use Internal switch with NAT enabled over.
    1. Run Hyper-V in a Virtual Machine with Nested Virtualization
  2. Download latest
    1. Windows 10 and install latest August 2, 2016 — KB3176929 (OS Build 14393.10). (https://support.microsoft.com/en-us/help/12387/windows-10-update-history)
    2. or: Windows Server 2016 TP5 from Insider program (min insiders build 14372) https://www.microsoft.com/en-us/evalcenter/evaluate-windows-server-technical-preview
    3. Use Standard Key: MFY9F-XBN2F-TYFMP-CCV49-RMYVH from Preinstallation instructions in order to do basic install.
    4. Default password policy requires to enter Administrator Password to contain: Big letters, Small letters, Digits.
    5. Using Local Security Policy - disable strict password policy.
      1. GPO_name\Computer Configuration\Windows Settings\Security Settings\Account Policies\Password Policy
      2. Password must meet complexity requirements
    6. Using Local Security Policy - allow running Edge under Administrator.
      1. Under Local Policies/Security Options navigate to “User Account Control Admin Approval Mode for the Built-in Administrator account“
      2. Set the policy to Enabled
      3. Windows 10 Edge can’t be opened using the built-in administrator account
  3. Enable updates, Enable Insider Mode, Enable Developer Mode
  4. Install Hyper-V Feature
    1. Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V -All
  5. Install Containers Feature
    1. Enable-WindowsOptionalFeature -Online -FeatureName containers -All
    2. Set-ItemProperty -Path 'HKLM:SOFTWARE\Microsoft\Windows NT\CurrentVersion\Virtualization\Containers' -Name VSmbDisableOplocks -Type DWord -Value 1 -Force
  6. Install Docker
    1. New-Item -Type Directory -Path "C:\Program Files\docker\"
    2. Invoke-WebRequest https://master.dockerproject.org/windows/amd64/dockerd.exe -OutFile $env:ProgramFiles\docker\dockerd.exe
    3. Invoke-WebRequest https://master.dockerproject.org/windows/amd64/docker.exe -OutFile $env:ProgramFiles\docker\docker.exe
    4. [Environment]::SetEnvironmentVariable("Path", $env:Path + ";$env:ProgramFiles\docker\", [EnvironmentVariableTarget]::Machine)
    5. & $env:ProgramFiles\docker\dockerd.exe --register-service
  7. Configure Docker daemon
    1. net localgroup docker /add
    2. net localgroup docker Administrator /add
    3. Set-ItemProperty -Path HKLM:\SYSTEM\CurrentControlSet\Services\docker -Name ImagePath -Value ""C:\Program Files\docker\dockerd.exe" --run-service -H npipe:// -H tcp://0.0.0.0:2375 -G docker -D"`
    4. Start-Service Docker
  8. Check Docker
    1. docker version
    2. docker info
  9. Fetch Docker logs
    1. Get-EventLog -LogName Application -Source Docker -After (Get-Date).AddMinutes(-5) | Sort-Object TimeGenerated
  10. Download default images depending on your host type (nano or gui)
    1. Set-ExecutionPolicy Bypass -scope Process
    2. Install-PackageProvider ContainerImage -Force
    3. Install image
    4. Install-ContainerImage -Name WindowsServerCore (obsolete)
    5. or: Install-ContainerImage -Name NanoServer (obsolete)
    6. or: Start-BitsTransfer https://aka.ms/tp5/6b/docker/nanoserver -Destination nanoserver.tar.gz; docker load -i nanoserver.tar.gz (obsolete)
    7. or: docker pull microsoft/nanoserver:10.0.14300.1030 (for Windows 10, Windows Server 2016 Nano)
    8. or: docker pull microsoft/windowsservercore:10.0.14300.1030 (for Windows Server 2016)
    9. Restart-Service docker
    10. docker tag microsoft/windowsservercore:10.0.14300.1030 windowsservercore:latest
  11. Deploy your first container
    1. docker run -it windowsservercore ping -t localhost
    2. or: docker run -it nanoserver ping -t localhost
  12. Docker machine install
    1. Install Chocolatey & iex (wget 'https://chocolatey.org/install.ps1' -UseBasicParsing), rm $profile
    2. choco install -y docker-machine
    3. choco install -y docker-compose

Related Articles

Related Issues

blog comments powered by Disqus