Skip to content

Commit

Permalink
Merge pull request #497 from pl4nty/Main
Browse files Browse the repository at this point in the history
Add example GitHub Actions workflow for BuildKit
  • Loading branch information
ntrappe-msft authored Sep 9, 2024
2 parents c1100ce + 98fc698 commit c521791
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 0 deletions.
5 changes: 5 additions & 0 deletions helpful_tools/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](./install_buildkit_workflow.yaml) can be used as an example.
33 changes: 33 additions & 0 deletions helpful_tools/GitHubActions/install_buildkit_workflow.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
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/[email protected]
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](./GitHubActions/)

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

0 comments on commit c521791

Please sign in to comment.