Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add example GitHub Actions workflow for BuildKit #497

Merged
merged 2 commits into from
Sep 9, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions helpful_tools/Install-BuildKit-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.
33 changes: 33 additions & 0 deletions helpful_tools/Install-BuildKit-GitHubActions/workflow.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Build
pl4nty marked this conversation as resolved.
Show resolved Hide resolved

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](./Install-BuildKit-GitHubActions/)

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