Skip to content

Instantly share code, notes, and snippets.

@SanyaNya
Created June 13, 2024 08:21
Show Gist options
  • Select an option

  • Save SanyaNya/0b107cfccb8311a68436eeab10a1ba28 to your computer and use it in GitHub Desktop.

Select an option

Save SanyaNya/0b107cfccb8311a68436eeab10a1ba28 to your computer and use it in GitHub Desktop.
Windows containers guide with cmd

Windows containers guide

Requirements: Windows 10/11 with Hyper-V feature

Tested on Windows 11 LTSC fresh install

  1. Open cmd with admin rights:
    1. Press Win+R
    2. Type "cmd" (without quotes)
    3. Press Ctrl+Shift+Enter
  2. Install chocolatey package manager (reference: https://docs.chocolatey.org/en-us/choco/setup#install-with-cmd.exe):
    @"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command "[System.Net.ServicePointManager]::SecurityProtocol = 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))" && SET "PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin"
  3. Enable Hyper-V Containers:
    choco install Containers Microsoft-Hyper-V --source windowsfeatures -y
  4. Install docker and dockerd(reference: https://community.chocolatey.org/packages/docker-engine):
    choco install docker-engine -y
  5. Unregister default dockerd service and register with custom size(default is 20G which is not enough for windows containers):
    cd "C:\Program Files\docker"
    dockerd --unregister-service
    dockerd --register-service --storage-opt size=YOUR_CONTAINER_SIZE
  6. Start docker service before using docker:
    net start docker
  7. Done! You are ready to build/run your windows containers.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment