Skip to content

Instantly share code, notes, and snippets.

@tonysneed
Last active August 20, 2019 20:45
Show Gist options
  • Save tonysneed/42032742828d23d07dc9467b972c2047 to your computer and use it in GitHub Desktop.
Save tonysneed/42032742828d23d07dc9467b972c2047 to your computer and use it in GitHub Desktop.
Install Docker on Windows Nano Server

Install Docker on Windows Nano Server

Connect remotely to the nano server

  1. Open PowerShell as Administrator
  2. Test-WSMan xx.xxx.xxx.xx
  3. Enable-PSRemoting
  4. Enter public IP address of nano server: $ip = "xx.xxx.xxx.xx"
    Set-Item WSMan:\localhost\Client\TrustedHosts "$ip" -Force
  5. Enter-PSSession -ComputerName $ip -Credential "~\Administrator"
    • Enter Password

Scan for Available Updates

  1. $ci = New-CimInstance -Namespace root/Microsoft/Windows/WindowsUpdate -ClassName MSFT_WUOperationsSession
  2. $result = $ci | Invoke-CimMethod -MethodName ScanForUpdates -Arguments @{SearchCriteria="IsInstalled=0";OnlineScan=$true}
  3. $result.Updates

Install Windows Updates

  1. $ci = New-CimInstance -Namespace root/Microsoft/Windows/WindowsUpdate -ClassName MSFT_WUOperationsSession
  2. Invoke-CimMethod -InputObject $ci -MethodName ApplyApplicableUpdates
  3. Restart-Computer; exit

Install Docker

  1. Install-Module -Name DockerMsftProvider -Repository PSGallery -Force
  2. Install-Package -Name docker -ProviderName DockerMsftProvider
  3. Restart-Computer -Force

Use Docker

  1. docker pull tonysneed/helloaspnet:nanoserver
  2. docker images
  3. docker run -d -p 80:5000 --name helloaspnet tonysneed/helloaspnet:nanoserver
  4. docker ps

Browse to public DNS or IP of Windows nano server

  1. http://xx.xxx.xxx.xx
    • You should see: Hello World!
@lonelysh
Copy link

lonelysh commented Jan 4, 2018

while running install-package on nanoserver, will call get-windowsfeature cmd that nano doesn't support

@jdholbrook81
Copy link

Any idea what this means? Brand new Windows 2016 server nano vm I spun up in azure. Happens at the end of the pull command.

docker : failed to register layer: re-exec error: exit status 1: output: ProcessBaseLayer
C:\ProgramData\docker\windowsfilter\5d26a92dc95558f86fbc03eb74013ce1f733adb9ec1e593c0db52dda8aa437d3: This operation returned because the timeout period expired.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment