4. Download and extract the latest BuildKit release.
```powershell
$version = "v0.13.1" # specify the release version, v0.13+
$arch = "amd64" # arm64 binary available too
curl.exe -LO https://github.com/moby/buildkit/releases/download/$version/buildkit-$version.windows-$arch.tar.gz
# there could be another `.\bin` directory from containerd instructions
# you can move those
mv bin bin2
tar.exe xvf .\buildkit-$version.windows-$arch.tar.gz
## x bin/
## x bin/buildctl.exe
## x bin/buildkitd.exe
```
5. Install BuildKit binaries on `PATH`.
```powershell
# after the binaries are extracted in the bin directory
# move them to an appropriate path in your $Env:PATH directories or:
Copy-Item -Path ".\bin" -Destination "$Env:ProgramFiles\buildkit" -Recurse -Force
# add `buildkitd.exe` and `buildctl.exe` binaries in the $Env:PATH
$Path = [Environment]::GetEnvironmentVariable("PATH", "Machine") + `
[IO.Path]::PathSeparator + "$Env:ProgramFiles\buildkit"
[Environment]::SetEnvironmentVariable( "Path", $Path, "Machine")
$Env:Path = [System.Environment]::GetEnvironmentVariable("Path","Machine") + ";" + `
[System.Environment]::GetEnvironmentVariable("Path","User")
```
6. Start the BuildKit daemon.
```console
> buildkitd.exe
```
7. In another terminal with administrator privileges, create a remote builder that uses the local BuildKit daemon.
> [!NOTE]
>
> This requires Docker Desktop version 4.29 or later.
```console
> docker buildx create --name buildkit-exp --use --driver=remote npipe:////./pipe/buildkitd
buildkit-exp
```
8. Verify the builder connection by running `docker buildx inspect`.
```console
> docker buildx inspect
```
The output should indicate that the builder platform is Windows,
and that the endpoint of the builder is a named pipe.
```text
Name: buildkit-exp
Driver: remote
Last Activity: 2024-04-15 17:51:58 +0000 UTC
Nodes:
Name: buildkit-exp0
Endpoint: npipe:////./pipe/buildkitd
Status: running
BuildKit version: v0.13.1
Platforms: windows/amd64
...
```
9. Create a Dockerfile and build a `hello-buildkit` image.
```console
> mkdir sample_dockerfile
> cd sample_dockerfile
> Set-Content Dockerfile @"
FROM mcr.microsoft.com/windows/nanoserver:ltsc2022
USER ContainerAdministrator
COPY hello.txt C:/
RUN echo "Goodbye!" >> hello.txt
CMD ["cmd", "/C", "type C:\\hello.txt"]
"@
Set-Content hello.txt @"
Hello from BuildKit!
This message shows that your installation appears to be working correctly.
"@
```
10. Build and push the image to a registry.
```console
> docker buildx build --push -t <username>/hello-buildkit .
```
11. After pushing to the registry, run the image with `docker run`.
```console
> docker run <username>/hello-buildkit
```