Skip to content

Commit da59e70

Browse files
Initial commit
0 parents  commit da59e70

File tree

6 files changed

+430
-0
lines changed

6 files changed

+430
-0
lines changed

.github/renovate.json5

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
{
2+
extends: [
3+
"config:base",
4+
"schedule:daily",
5+
],
6+
commitMessageSuffix: " in {{packageFile}}",
7+
dependencyDashboard: false,
8+
automerge: true,
9+
baseBranches: ["master"],
10+
platformAutomerge: true,
11+
labels: ["dependencies"],
12+
prHourlyLimit: 1,
13+
lockFileMaintenance: {
14+
enabled: true,
15+
},
16+
vulnerabilityAlerts: {
17+
enabled: true,
18+
labels: [
19+
"security",
20+
],
21+
},
22+
regexManagers: [
23+
{
24+
fileMatch: ["(^|/)Dockerfile$", "(^|/)Dockerfile\\.[^/]*$"],
25+
matchStrings: [
26+
"renovate: datasource=(?<datasource>.*?) depName=(?<depName>.*?)( versioning=(?<versioning>.*?))?\\sARG .*?_VERSION=(?<currentValue>.*)\\s",
27+
],
28+
versioningTemplate: "{{#if versioning}}{{{versioning}}}{{else}}semver{{/if}}",
29+
extractVersionTemplate: '^v(?<version>\\d+\\.\\d+\\.\\d+)',
30+
},
31+
]
32+
}

.github/workflows/build.yml

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
name: Build
2+
3+
on:
4+
push:
5+
branches:
6+
- "master"
7+
workflow_dispatch: {}
8+
9+
10+
concurrency:
11+
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
12+
cancel-in-progress: true
13+
14+
env:
15+
SETUP_BUILDX_VERSION: "edge"
16+
REPO_SLUG_TARGET: "sectorlabs/buildkit"
17+
18+
jobs:
19+
image:
20+
name: Image
21+
22+
runs-on: ubuntu-24.04
23+
24+
strategy:
25+
fail-fast: false
26+
matrix:
27+
flavor:
28+
- ''
29+
- 'rootless'
30+
31+
permissions:
32+
contents: read
33+
packages: write
34+
35+
steps:
36+
- name: Checkout
37+
uses: actions/checkout@v4
38+
39+
- name: Login to Packages Container registry
40+
uses: docker/login-action@v3
41+
with:
42+
registry: ghcr.io
43+
username: ${{ github.actor }}
44+
password: ${{ secrets.GITHUB_TOKEN }}
45+
46+
- name: Set up QEMU
47+
uses: docker/setup-qemu-action@v3
48+
49+
- name: Set up Docker Buildx
50+
uses: docker/setup-buildx-action@v3
51+
with:
52+
version: ${{ env.SETUP_BUILDX_VERSION }}
53+
driver-opts: image=ghcr.io/sectorlabs/buildkit:latest
54+
55+
- name: Compute BuildKit version
56+
run: echo "BUILDKIT_VERSION=$(cat ./Dockerfile | sed -nr 's/ARG BUILDKIT_VERSION=(.*)/\1/p')" >> $GITHUB_ENV
57+
58+
- name: Build and push
59+
uses: docker/build-push-action@v6
60+
with:
61+
context: .
62+
platforms: linux/arm64,linux/amd64
63+
push: true
64+
tags: |
65+
ghcr.io/${{ env.REPO_SLUG_TARGET }}:${{ env.BUILDKIT_VERSION }}
66+
ghcr.io/${{ env.REPO_SLUG_TARGET }}:${{ matrix.flavor == '' && 'latest' || 'rootless' }}
67+
target: ${{ matrix.flavor }}
68+
cache-to: type=gha,mode=max,ignore-error=true
69+
cache-from: type=gha
70+
71+
tag:
72+
name: Tag Stable
73+
74+
runs-on: ubuntu-24.04
75+
76+
needs: [image]
77+
78+
permissions:
79+
contents: read
80+
actions: write
81+
82+
steps:
83+
- name: Checkout
84+
uses: actions/checkout@v4
85+
86+
- name: Dispatch Tag Stable Workflow
87+
env:
88+
GH_TOKEN: ${{ github.token }}
89+
run: |
90+
gh workflow run "stable.yml" --ref ${{ github.ref }} -f source-tag=latest -f dest-tag=buildx-stable-1 -f dry-run=false

.github/workflows/stable.yml

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
#
2+
# Modified https://github.com/moby/buildkit/blob/81d49f78197cd471bb92ed800a4873384389bfd4/.github/workflows/buildx-image.yml
3+
#
4+
5+
# source latest
6+
# dest buildx-stable-1
7+
# result ghcr.io/sectorlabs/buildkit:latest > ghcr.io/sectorlabs/buildkit:buildx-stable-1
8+
# ghcr.io/sectorlabs/buildkit:rootless > ghcr.io/sectorlabs/buildkit:buildx-stable-1-rootless
9+
#
10+
# source v0.8.1
11+
# dest buildx-stable-1
12+
# result ghcr.io/sectorlabs/buildkit:v0.8.1 > ghcr.io/sectorlabs/buildkit:buildx-stable-1
13+
# ghcr.io/sectorlabs/buildkit:v0.8.1-rootless > ghcr.io/sectorlabs/buildkit:buildx-stable-1-rootless
14+
name: Tag stable
15+
16+
on:
17+
workflow_dispatch:
18+
inputs:
19+
source-tag:
20+
description: 'BuildKit source Docker tag'
21+
required: true
22+
default: 'latest'
23+
dest-tag:
24+
description: 'Default BuildKit Docker tag for buildx'
25+
required: true
26+
default: 'buildx-stable-1'
27+
dry-run:
28+
description: 'Dry run'
29+
required: false
30+
default: 'true'
31+
32+
concurrency:
33+
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
34+
cancel-in-progress: true
35+
36+
permissions:
37+
contents: read
38+
packages: write
39+
40+
env:
41+
SETUP_BUILDX_VERSION: "edge"
42+
REPO_SLUG_TARGET: "sectorlabs/buildkit"
43+
44+
jobs:
45+
create:
46+
name: Create
47+
48+
runs-on: ubuntu-24.04
49+
50+
strategy:
51+
fail-fast: false
52+
matrix:
53+
flavor:
54+
- ''
55+
- 'rootless'
56+
57+
steps:
58+
- name: Login to Packages Container registry
59+
uses: docker/login-action@v3
60+
with:
61+
registry: ghcr.io
62+
username: ${{ github.actor }}
63+
password: ${{ secrets.GITHUB_TOKEN }}
64+
65+
- name: Set up Docker Buildx
66+
uses: docker/setup-buildx-action@v3
67+
with:
68+
version: ${{ env.SETUP_BUILDX_VERSION }}
69+
driver-opts: image=ghcr.io/sectorlabs/buildkit:latest
70+
71+
- name: Create
72+
run: |
73+
DRYRUN_FLAG=""
74+
if [ "${{ github.event.inputs.dry-run }}" = "true" ]; then
75+
DRYRUN_FLAG="--dry-run"
76+
fi
77+
78+
SOURCE_TAG="${{ github.event.inputs.source-tag }}"
79+
DEST_TAG="${{ github.event.inputs.dest-tag }}"
80+
if [ "${{ matrix.flavor }}" != "" ]; then
81+
if [ "$SOURCE_TAG" = "latest" ]; then
82+
SOURCE_TAG="${{ matrix.flavor }}"
83+
else
84+
SOURCE_TAG="${SOURCE_TAG}-${{ matrix.flavor }}"
85+
fi
86+
DEST_TAG="${DEST_TAG}-${{ matrix.flavor }}"
87+
fi
88+
89+
set -x
90+
docker buildx imagetools create ${DRYRUN_FLAG} --tag \
91+
"ghcr.io/${{ env.REPO_SLUG_TARGET }}:${DEST_TAG}" \
92+
"ghcr.io/${{ env.REPO_SLUG_TARGET }}:${SOURCE_TAG}"

Dockerfile

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# syntax=docker/dockerfile:1
2+
3+
# renovate: datasource=github-releases depName=moby/buildkit
4+
ARG BUILDKIT_VERSION=0.19.0
5+
6+
FROM moby/buildkit:v${BUILDKIT_VERSION}
7+
8+
FROM moby/buildkit:v${BUILDKIT_VERSION}-rootless AS rootless

0 commit comments

Comments
 (0)