Skip to content

Commit

Permalink
Add example GitHub Actions workflow for BuildKit
Browse files Browse the repository at this point in the history
Discussed in microsoft#34
  • Loading branch information
pl4nty committed May 18, 2024
1 parent eabfe07 commit 50cb33e
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 0 deletions.
5 changes: 5 additions & 0 deletions helpful_tools/Install-BuiltKit-GitHubActions/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# BuildKit GitHub Actions Example

[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.

This [workflow file](./workflow.yaml) can be used as an example.
36 changes: 36 additions & 0 deletions helpful_tools/Install-BuiltKit-GitHubActions/workflow.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Build

on:
push:

jobs:
main:
runs-on: windows-latest
steps:
- name: Setup containerd
run: |
$version = "1.7.15"
curl.exe -L https://github.com/containerd/containerd/releases/download/v$version/containerd-$version-windows-amd64.tar.gz -o containerd.tar.gz
tar.exe xvf containerd.tar.gz
.\bin\containerd.exe --register-service
Start-Service containerd
- name: Setup BuildKit
run: |
$version = "v0.13.1"
curl.exe -L https://github.com/moby/buildkit/releases/download/$version/buildkit-$version.windows-amd64.tar.gz -o buildkit.tar.gz
tar.exe xvf buildkit.tar.gz
.\bin\buildkitd.exe --register-service
Start-Service buildkitd
- name: Setup Docker Buildx
run: |
$version = "v0.13.1"
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
- uses: docker/setup-buildx-action@v3.2.0
with:
driver: remote
endpoint: npipe:////./pipe/buildkitd
1 change: 1 addition & 0 deletions helpful_tools/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ A container runtime is software that executes containers and manages container i
- Handles the complete container lifecycle, including image transfer and storage, container execution and supervision, and low-level storage and network attachments.
- 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.
#### [👉 Install ContainerD with PowerShell](https://github.com/microsoft/Windows-Containers/tree/Main/helpful_tools/Install-ContainerdRuntime)
#### [👉 Install ContainerD and BuildKit on GitHub Actions](https://github.com/microsoft/Windows-Containers/tree/Main/helpful_tools/Install-BuildKit-GitHubActions)

## System Information Tools
### 3. Query Job Limits
Expand Down

0 comments on commit 50cb33e

Please sign in to comment.