initial commit
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
# Dockerfile test build
|
||||
|
||||
```yaml
|
||||
name: Docker Build CI
|
||||
on: [ push ]
|
||||
|
||||
env:
|
||||
BUILDKIT_VERSION: 'v0.29.0'
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v5
|
||||
- uses: actions/cache@v4
|
||||
with:
|
||||
path: /var/lib/buildkit
|
||||
key: ${{ runner.os }}-buildkit-${{ env.BUILDKIT_VERSION }}
|
||||
- uses: https://git.klemek.fr/klemek/dockerfile-test-build@v1
|
||||
with:
|
||||
buildkit_version: ${{ env.BUILDKIT_VERSION }}
|
||||
```
|
||||
+40
@@ -0,0 +1,40 @@
|
||||
name: 'Dockerfile test build'
|
||||
description: 'Test build of Dockerfile'
|
||||
inputs:
|
||||
dockerfile:
|
||||
description: 'Dockerfile name'
|
||||
required: true
|
||||
default: '.'
|
||||
context:
|
||||
description: 'Build context'
|
||||
required: true
|
||||
default: '.'
|
||||
buildkit_version:
|
||||
description: 'Buildkit version'
|
||||
required: true
|
||||
runs:
|
||||
using: "composite"
|
||||
steps:
|
||||
- name: Prepare buildkit directory
|
||||
shell: bash
|
||||
run: mkdir -p /var/lib/buildkit
|
||||
|
||||
- name: Download buildkit binaries
|
||||
shell: bash
|
||||
run: |
|
||||
wget -nc -O /var/lib/buildkit/buildkit.tar.gz \
|
||||
https://github.com/moby/buildkit/releases/download/${{ inputs.buildkit_version }}/buildkit-${{ inputs.buildkit_version }}.linux-amd64.tar.gz
|
||||
|
||||
- name: Extract buildkit binaries
|
||||
shell: bash
|
||||
run: tar -xf /var/lib/buildkit/buildkit.tar.gz -C /var/lib/buildkit
|
||||
|
||||
- name: Run buildkit build
|
||||
shell: bash
|
||||
run: |
|
||||
/var/lib/buildkit/bin/buildkitd & \
|
||||
while [ ! -f /run/buildkit/buildkitd.sock ]; do sleep 0.1; done && \
|
||||
/var/lib/buildkit/bin/buildctl build \
|
||||
--frontend=dockerfile.v0 \
|
||||
--local context=${{ inputs.context }} \
|
||||
--local dockerfile=${{ inputs.dockerfile }}
|
||||
Reference in New Issue
Block a user