Skip to content

Commit c521791

Browse files
authored
Merge pull request #497 from pl4nty/Main
Add example GitHub Actions workflow for BuildKit
2 parents c1100ce + 98fc698 commit c521791

3 files changed

Lines changed: 39 additions & 0 deletions

File tree

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# BuildKit GitHub Actions Example
2+
3+
[Docker is pinned to v24.0.7](https://github.com/actions/runner-images/issues/9478) on GitHub Actions hosted Windows runners, so containerd and BuildKit need to be installed manually.
4+
5+
This [workflow file](./install_buildkit_workflow.yaml) can be used as an example.
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Build
2+
3+
on:
4+
push:
5+
6+
jobs:
7+
main:
8+
runs-on: windows-latest
9+
steps:
10+
- name: Setup containerd
11+
run: |
12+
$version = "1.7.15"
13+
curl.exe -L https://github.com/containerd/containerd/releases/download/v$version/containerd-$version-windows-amd64.tar.gz -o containerd.tar.gz
14+
tar.exe xvf containerd.tar.gz
15+
16+
.\bin\containerd.exe --register-service
17+
Start-Service containerd
18+
- name: Setup BuildKit
19+
run: |
20+
$version = "v0.13.1"
21+
curl.exe -L https://github.com/moby/buildkit/releases/download/$version/buildkit-$version.windows-amd64.tar.gz -o buildkit.tar.gz
22+
tar.exe xvf buildkit.tar.gz
23+
24+
.\bin\buildkitd.exe --register-service
25+
Start-Service buildkitd
26+
- name: Setup Docker Buildx
27+
run: |
28+
$version = "v0.13.1"
29+
curl.exe -L https://github.com/docker/buildx/releases/download/$version/buildx-$version.windows-amd64.exe -o $env:ProgramData\Docker\cli-plugins\docker-buildx.exe
30+
- uses: docker/setup-buildx-action@v3.2.0
31+
with:
32+
driver: remote
33+
endpoint: npipe:////./pipe/buildkitd

helpful_tools/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ A container runtime is software that executes containers and manages container i
1616
- Handles the complete container lifecycle, including image transfer and storage, container execution and supervision, and low-level storage and network attachments.
1717
- Use containerd when you need an efficient runtime, particularly in resource-constrained environments like embedded systems or IoT devices, or when embedding into a larger system.
1818
#### [👉 Install ContainerD with PowerShell](https://github.com/microsoft/Windows-Containers/tree/Main/helpful_tools/Install-ContainerdRuntime)
19+
#### [👉 Install ContainerD and BuildKit on GitHub Actions](./GitHubActions/)
1920

2021
## System Information Tools
2122
### 3. Query Job Limits

0 commit comments

Comments
 (0)