Skip to content

Instantly share code, notes, and snippets.

@rpavlik
Created April 21, 2025 19:53
Show Gist options
  • Save rpavlik/6e48eac47032540b9a045adf1d611cc2 to your computer and use it in GitHub Desktop.
Save rpavlik/6e48eac47032540b9a045adf1d611cc2 to your computer and use it in GitHub Desktop.
Setting up gcp for windows containers
Add-WindowsFeature Containers
# Containerd - from their getting started.
# Download and extract desired containerd Windows binaries
$Version="1.7.13" # update to your preferred version
$Arch = "amd64" # arm64 also available
curl.exe -LO https://github.com/containerd/containerd/releases/download/v$Version/containerd-$Version-windows-$Arch.tar.gz
tar.exe xvf .\containerd-$Version-windows-$Arch.tar.gz
# Copy
Copy-Item -Path .\bin -Destination $Env:ProgramFiles\containerd -Recurse -Force
# add the binaries (containerd.exe, ctr.exe) in $env:Path
$Path = [Environment]::GetEnvironmentVariable("PATH", "Machine") + [IO.Path]::PathSeparator + "$Env:ProgramFiles\containerd"
[Environment]::SetEnvironmentVariable( "Path", $Path, "Machine")
# reload path, so you don't have to open a new PS terminal later if needed
$Env:Path = [System.Environment]::GetEnvironmentVariable("Path","Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path","User")
# configure
containerd.exe config default | Out-File $Env:ProgramFiles\containerd\config.toml -Encoding ascii
# Register and start service
containerd.exe --register-service
Start-Service containerd
## Nerdctl
curl.exe -LO https://github.com/containerd/nerdctl/releases/download/v2.0.4/nerdctl-2.0.4-windows-amd64.tar.gz
tar.exe xvf .\nerdctl-2.0.4-windows-amd64.tar.gz
# Put it in the path too
Copy-Item -Path .\nerdctl.exe -Destination $Env:ProgramFiles\containerd -Force
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment