Skip to content

Instantly share code, notes, and snippets.

@profnandaa
Created August 24, 2023 15:18
Show Gist options
  • Save profnandaa/e86d6c4fa48ba759e4bc09acc587e880 to your computer and use it in GitHub Desktop.
Save profnandaa/e86d6c4fa48ba759e4bc09acc587e880 to your computer and use it in GitHub Desktop.
Setup Buildkit on Windows
quick instructions
==================
you will need https://github.com/containerd/containerd/releases/tag/v1.7.3
installed and running with default config
you will also need a proper CNI installed
https://gist.github.com/gabriel-samfira/c1d060fc07156cfa1e00e7cef8e7fb1c
i usually use this to set up containerd
after you have containerd installed you will need buildkit\
git clone https://github.com/moby/buildkit.git
cd buildkit
git remote add gabriel-samfira https://github.com/gabriel-samfira/buildkit/
git fetch gabriel-samfira
git checkout master
git branch staging
git checkout staging
git merge enable-windows-executor
git merge fileop-read-user
go install .\cmd\...
buildkitd.exe --debug --containerd-worker=true --containerd-cni-config-path='C:/Program Files/containerd/cni/conf/0-containerd-nat.conf' --containerd-cni-binary-dir='C:/Program Files/containerd/cni/bin' --service-name buildkitd --register-service
this will install the buildkit service
start-service containerd
start-service buildkitd
and you should be all set
to build a Dockerfile that resides in your current folder, you can run:
buildctl.exe build --output type=image,name=docker.samfira.com/test,push=false --progress plain --frontend=dockerfile.v0 --local context=. --local dockerfile=.
change the image name to something else if you wish
if you want the standard buildkit progress, remove --progress plain
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment