Skip to content

Instantly share code, notes, and snippets.

gabriel-samfira /
Created August 31, 2023 13:15
Install Buildkitd on Windows

Installing buildkit on Windows from source

This will set up buildkitd natively on Windows Server 2019 (ltsc2019) or Windows Server 2022 (ltsc2022).

Enable the containers feature

This will reboot your server if the feature is not already installed.

Install-WindowsFeature -Name containers -Restart
gabriel-samfira / setup_buildkitd_on_windows.ps1
Last active August 31, 2023 13:00
Install buildkitd on Windows
View setup_buildkitd_on_windows.ps1
$containerdDir = join-path $env:ProgramFiles containerd
if (!(Test-Path $containerdDir)){
mkdir $containerdDir
$downloadPath = Join-Path $env:Tmp "containerd.tar.gz"
$downloadLink = ""
View set_owner.go
package main
import (
View docker build output
C:\Users\Administrator\work\playground\with-drive-letter>docker build -t .
Sending build context to Docker daemon 5.253MB
Step 1/19 : FROM
ltsc2022: Pulling from windows/nanoserver
9e0d440fca83: Already exists
Digest: sha256:3bb312dcc36fa551766a13cf2fb8e2be90726774589c96bea9198a26307bf2a2
Status: Downloaded newer image for
---> 0c7fb865d8dc
Step 2/19 : ADD /bin/busybox.exe
Downloading [==================================================>] 575kB/575kB
View Dockerfile
# Copyright The containerd Authors.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,

Local test env of k8s and containerd (the hard way)


  • You're running on an ubuntu 20.04 VM/physical server
  • Your IP address is: (obviously you will need to adust this to your env)
  • The hostname of the machine is k8s-test
  • The windows node we'll be adding is a Windows Server 2022 (ltsc2022)

Obviously you will need to adust these assumptions to your env. But for clarity we define these assumptions here.

gabriel-samfira /
Last active June 3, 2022 12:24
Prepare a Windows server machine for containerd tests


The scripts in this gist are mostly taken from the containerd repo with some small changes. Feel free to inspect them and see what they do.

Install required features

# If the feature is not already installed, this will install it
# and reboot your machine.
Install-WindowsFeature -Name Containers -Restart
View setup_env.ps1
# Considerable performance boost withour realtime monitoring.
# This is usually okay on temporary test systems. Don't do this
# on your own machine.
Set-MpPreference -DisableRealtimeMonitoring:$true
wget -UseBasicParsing -OutFile "$HOME\prepare_env_windows.ps1" -Uri
& "$HOME\prepare_env_windows.ps1"
gabriel-samfira / prepare_env_windows.ps1
Last active August 31, 2023 11:08
Installs needed dependencies
View prepare_env_windows.ps1
# Prepare windows environment for building and running containerd tests
$PACKAGES= @{ mingw = "12.2.0"; git = ""; golang = ""; make = ""}
Write-Host "Downloading chocolatey package"
curl.exe -L "" -o 'c:\'
Expand-Archive "c:\" -DestinationPath "c:\choco"
Write-Host "Installing choco"
& "c:\choco\tools\chocolateyInstall.ps1"
gabriel-samfira / enable_ssh_on_windows.ps1
Created November 9, 2021 10:57
slight improvement to fetch ssh keys from github
View enable_ssh_on_windows.ps1
$ErrorActionPreference = "Stop"
function Get-SSHKeyFromGithub {