2020-08-16 06:36:41 +08:00
|
|
|
name: ci
|
|
|
|
|
2023-09-05 16:59:10 +08:00
|
|
|
concurrency:
|
|
|
|
group: ${{ github.workflow }}-${{ github.ref }}
|
|
|
|
cancel-in-progress: true
|
|
|
|
|
2020-08-16 06:36:41 +08:00
|
|
|
on:
|
2020-10-23 06:38:26 +08:00
|
|
|
workflow_dispatch:
|
2022-08-12 22:45:35 +08:00
|
|
|
inputs:
|
|
|
|
buildx-version:
|
|
|
|
description: 'Buildx version or Git context'
|
|
|
|
default: 'latest'
|
|
|
|
required: false
|
|
|
|
buildkit-image:
|
|
|
|
description: 'BuildKit image'
|
|
|
|
default: 'moby/buildkit:buildx-stable-1'
|
|
|
|
required: false
|
2023-02-21 05:54:11 +08:00
|
|
|
schedule:
|
|
|
|
- cron: '0 10 * * *'
|
2020-08-16 06:36:41 +08:00
|
|
|
push:
|
2020-09-13 02:53:25 +08:00
|
|
|
branches:
|
2022-01-18 21:57:27 +08:00
|
|
|
- 'master'
|
2023-02-21 05:54:11 +08:00
|
|
|
- 'releases/v*'
|
2020-08-16 06:36:41 +08:00
|
|
|
pull_request:
|
|
|
|
|
2022-08-17 08:17:37 +08:00
|
|
|
env:
|
2023-11-16 21:21:56 +08:00
|
|
|
BUILDX_VERSION: latest
|
2022-08-17 08:17:37 +08:00
|
|
|
BUILDKIT_IMAGE: moby/buildkit:buildx-stable-1
|
|
|
|
|
2020-08-16 06:36:41 +08:00
|
|
|
jobs:
|
2020-10-20 04:17:35 +08:00
|
|
|
minimal:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
-
|
|
|
|
name: Checkout
|
2023-09-05 15:31:24 +08:00
|
|
|
uses: actions/checkout@v4
|
2020-10-20 04:17:35 +08:00
|
|
|
with:
|
|
|
|
path: action
|
|
|
|
-
|
|
|
|
name: Set up Docker Buildx
|
2023-09-12 19:17:11 +08:00
|
|
|
uses: docker/setup-buildx-action@v3
|
2022-08-12 22:45:35 +08:00
|
|
|
with:
|
2022-08-17 08:17:37 +08:00
|
|
|
version: ${{ inputs.buildx-version || env.BUILDX_VERSION }}
|
2022-08-12 22:45:35 +08:00
|
|
|
driver-opts: |
|
2022-08-17 08:17:37 +08:00
|
|
|
image=${{ inputs.buildkit-image || env.BUILDKIT_IMAGE }}
|
2020-10-20 04:17:35 +08:00
|
|
|
-
|
|
|
|
name: Build
|
|
|
|
uses: ./action
|
|
|
|
with:
|
|
|
|
file: ./test/Dockerfile
|
|
|
|
|
2020-09-02 16:07:11 +08:00
|
|
|
git-context:
|
2020-08-18 04:18:15 +08:00
|
|
|
runs-on: ubuntu-latest
|
2020-09-23 02:53:40 +08:00
|
|
|
services:
|
|
|
|
registry:
|
|
|
|
image: registry:2
|
|
|
|
ports:
|
|
|
|
- 5000:5000
|
|
|
|
steps:
|
|
|
|
-
|
|
|
|
name: Checkout
|
2023-09-05 15:31:24 +08:00
|
|
|
uses: actions/checkout@v4
|
2020-10-04 04:44:16 +08:00
|
|
|
with:
|
|
|
|
path: action
|
2020-09-23 02:53:40 +08:00
|
|
|
-
|
|
|
|
name: Set up QEMU
|
2023-09-12 19:17:07 +08:00
|
|
|
uses: docker/setup-qemu-action@v3
|
2020-09-23 02:53:40 +08:00
|
|
|
-
|
|
|
|
name: Set up Docker Buildx
|
|
|
|
id: buildx
|
2023-09-12 19:17:11 +08:00
|
|
|
uses: docker/setup-buildx-action@v3
|
2020-09-23 02:53:40 +08:00
|
|
|
with:
|
2022-08-17 08:17:37 +08:00
|
|
|
version: ${{ inputs.buildx-version || env.BUILDX_VERSION }}
|
2022-08-12 22:45:35 +08:00
|
|
|
driver-opts: |
|
|
|
|
network=host
|
2022-08-17 08:17:37 +08:00
|
|
|
image=${{ inputs.buildkit-image || env.BUILDKIT_IMAGE }}
|
2020-09-23 02:53:40 +08:00
|
|
|
-
|
|
|
|
name: Build and push
|
|
|
|
id: docker_build
|
2020-10-04 04:44:16 +08:00
|
|
|
uses: ./action
|
2020-09-23 02:53:40 +08:00
|
|
|
with:
|
|
|
|
file: ./test/Dockerfile
|
|
|
|
builder: ${{ steps.buildx.outputs.name }}
|
|
|
|
platforms: linux/amd64,linux/arm64
|
|
|
|
push: true
|
|
|
|
tags: |
|
|
|
|
localhost:5000/name/app:latest
|
|
|
|
localhost:5000/name/app:1.0.0
|
|
|
|
-
|
|
|
|
name: Inspect
|
|
|
|
run: |
|
2023-01-11 21:03:02 +08:00
|
|
|
docker buildx imagetools inspect localhost:5000/name/app:1.0.0 --format '{{json .}}'
|
2020-10-21 15:51:06 +08:00
|
|
|
-
|
|
|
|
name: Check digest
|
|
|
|
run: |
|
|
|
|
if [ -z "${{ steps.docker_build.outputs.digest }}" ]; then
|
|
|
|
echo "::error::Digest should not be empty"
|
|
|
|
exit 1
|
|
|
|
fi
|
2020-09-23 02:53:40 +08:00
|
|
|
|
|
|
|
git-context-secret:
|
|
|
|
runs-on: ubuntu-latest
|
2020-09-05 11:18:15 +08:00
|
|
|
services:
|
|
|
|
registry:
|
|
|
|
image: registry:2
|
|
|
|
ports:
|
|
|
|
- 5000:5000
|
2020-08-18 04:18:15 +08:00
|
|
|
steps:
|
|
|
|
-
|
|
|
|
name: Checkout
|
2023-09-05 15:31:24 +08:00
|
|
|
uses: actions/checkout@v4
|
2020-10-04 04:44:16 +08:00
|
|
|
with:
|
|
|
|
path: action
|
2020-08-18 04:18:15 +08:00
|
|
|
-
|
|
|
|
name: Set up QEMU
|
2023-09-12 19:17:07 +08:00
|
|
|
uses: docker/setup-qemu-action@v3
|
2020-08-18 04:18:15 +08:00
|
|
|
-
|
|
|
|
name: Set up Docker Buildx
|
|
|
|
id: buildx
|
2023-09-12 19:17:11 +08:00
|
|
|
uses: docker/setup-buildx-action@v3
|
2020-08-18 04:18:15 +08:00
|
|
|
with:
|
2022-08-17 08:17:37 +08:00
|
|
|
version: ${{ inputs.buildx-version || env.BUILDX_VERSION }}
|
2022-08-12 22:45:35 +08:00
|
|
|
driver-opts: |
|
|
|
|
network=host
|
2022-08-17 08:17:37 +08:00
|
|
|
image=${{ inputs.buildkit-image || env.BUILDKIT_IMAGE }}
|
2020-08-18 04:18:15 +08:00
|
|
|
-
|
|
|
|
name: Build and push
|
|
|
|
id: docker_build
|
2020-10-04 04:44:16 +08:00
|
|
|
uses: ./action
|
2020-08-18 04:18:15 +08:00
|
|
|
with:
|
|
|
|
file: ./test/Dockerfile
|
|
|
|
builder: ${{ steps.buildx.outputs.name }}
|
2020-09-02 16:07:11 +08:00
|
|
|
platforms: linux/amd64,linux/arm64
|
2020-08-18 04:18:15 +08:00
|
|
|
push: true
|
|
|
|
tags: |
|
|
|
|
localhost:5000/name/app:latest
|
|
|
|
localhost:5000/name/app:1.0.0
|
2020-09-02 16:07:11 +08:00
|
|
|
secrets: |
|
2020-09-23 17:04:40 +08:00
|
|
|
GIT_AUTH_TOKEN=${{ github.token }}
|
2020-11-18 04:38:45 +08:00
|
|
|
"MYSECRET=aaaaaaaa
|
|
|
|
bbbbbbb
|
|
|
|
ccccccccc"
|
|
|
|
FOO=bar
|
|
|
|
"EMPTYLINE=aaaa
|
|
|
|
|
|
|
|
bbbb
|
|
|
|
ccc"
|
2020-08-18 04:18:15 +08:00
|
|
|
-
|
|
|
|
name: Inspect
|
|
|
|
run: |
|
2023-01-11 21:03:02 +08:00
|
|
|
docker buildx imagetools inspect localhost:5000/name/app:1.0.0 --format '{{json .}}'
|
2020-10-21 15:51:06 +08:00
|
|
|
-
|
|
|
|
name: Check digest
|
|
|
|
run: |
|
|
|
|
if [ -z "${{ steps.docker_build.outputs.digest }}" ]; then
|
|
|
|
echo "::error::Digest should not be empty"
|
|
|
|
exit 1
|
|
|
|
fi
|
2020-08-18 04:18:15 +08:00
|
|
|
|
2020-09-02 16:07:11 +08:00
|
|
|
path-context:
|
2020-08-16 06:36:41 +08:00
|
|
|
runs-on: ubuntu-latest
|
2020-09-05 11:18:15 +08:00
|
|
|
services:
|
|
|
|
registry:
|
|
|
|
image: registry:2
|
|
|
|
ports:
|
|
|
|
- 5000:5000
|
2020-08-16 06:36:41 +08:00
|
|
|
steps:
|
|
|
|
-
|
|
|
|
name: Checkout
|
2023-09-05 15:31:24 +08:00
|
|
|
uses: actions/checkout@v4
|
2020-08-16 06:36:41 +08:00
|
|
|
-
|
|
|
|
name: Set up QEMU
|
2023-09-12 19:17:07 +08:00
|
|
|
uses: docker/setup-qemu-action@v3
|
2020-08-16 06:36:41 +08:00
|
|
|
-
|
|
|
|
name: Set up Docker Buildx
|
|
|
|
id: buildx
|
2023-09-12 19:17:11 +08:00
|
|
|
uses: docker/setup-buildx-action@v3
|
2020-08-17 08:33:38 +08:00
|
|
|
with:
|
2022-08-17 08:17:37 +08:00
|
|
|
version: ${{ inputs.buildx-version || env.BUILDX_VERSION }}
|
2022-08-12 22:45:35 +08:00
|
|
|
driver-opts: |
|
|
|
|
network=host
|
2022-08-17 08:17:37 +08:00
|
|
|
image=${{ inputs.buildkit-image || env.BUILDKIT_IMAGE }}
|
2020-08-16 06:36:41 +08:00
|
|
|
-
|
|
|
|
name: Build and push
|
2020-08-23 10:07:29 +08:00
|
|
|
id: docker_build
|
2020-08-16 06:36:41 +08:00
|
|
|
uses: ./
|
|
|
|
with:
|
|
|
|
context: ./test
|
2020-09-02 16:07:11 +08:00
|
|
|
file: ./test/Dockerfile
|
2020-08-16 09:21:48 +08:00
|
|
|
builder: ${{ steps.buildx.outputs.name }}
|
2020-08-17 08:33:38 +08:00
|
|
|
push: true
|
2020-08-16 06:36:41 +08:00
|
|
|
tags: |
|
|
|
|
localhost:5000/name/app:latest
|
|
|
|
localhost:5000/name/app:1.0.0
|
2020-08-17 08:42:46 +08:00
|
|
|
-
|
|
|
|
name: Inspect
|
|
|
|
run: |
|
2023-01-11 21:03:02 +08:00
|
|
|
docker buildx imagetools inspect localhost:5000/name/app:1.0.0 --format '{{json .}}'
|
2020-10-21 08:46:41 +08:00
|
|
|
-
|
|
|
|
name: Check digest
|
|
|
|
run: |
|
|
|
|
if [ -z "${{ steps.docker_build.outputs.digest }}" ]; then
|
|
|
|
echo "::error::Digest should not be empty"
|
|
|
|
exit 1
|
|
|
|
fi
|
2020-08-16 23:18:08 +08:00
|
|
|
|
2023-02-21 05:59:45 +08:00
|
|
|
example:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
env:
|
|
|
|
DOCKER_IMAGE: localhost:5000/name/app
|
|
|
|
services:
|
|
|
|
registry:
|
|
|
|
image: registry:2
|
|
|
|
ports:
|
|
|
|
- 5000:5000
|
|
|
|
steps:
|
|
|
|
-
|
|
|
|
name: Checkout
|
2023-09-05 15:31:24 +08:00
|
|
|
uses: actions/checkout@v4
|
2023-02-21 05:59:45 +08:00
|
|
|
-
|
|
|
|
name: Docker meta
|
|
|
|
id: meta
|
2023-09-12 19:17:15 +08:00
|
|
|
uses: docker/metadata-action@v5
|
2023-02-21 05:59:45 +08:00
|
|
|
with:
|
|
|
|
images: ${{ env.DOCKER_IMAGE }}
|
|
|
|
tags: |
|
|
|
|
type=schedule
|
|
|
|
type=ref,event=branch
|
|
|
|
type=ref,event=pr
|
|
|
|
type=semver,pattern={{version}}
|
|
|
|
type=semver,pattern={{major}}.{{minor}}
|
|
|
|
type=semver,pattern={{major}}
|
|
|
|
type=sha
|
|
|
|
-
|
|
|
|
name: Set up Docker Buildx
|
2023-09-12 19:17:11 +08:00
|
|
|
uses: docker/setup-buildx-action@v3
|
2023-02-21 05:59:45 +08:00
|
|
|
with:
|
|
|
|
version: ${{ inputs.buildx-version || env.BUILDX_VERSION }}
|
|
|
|
driver-opts: |
|
|
|
|
network=host
|
|
|
|
image=${{ inputs.buildkit-image || env.BUILDKIT_IMAGE }}
|
|
|
|
-
|
|
|
|
name: Build and export to Docker client
|
|
|
|
uses: ./
|
|
|
|
with:
|
|
|
|
context: ./test
|
|
|
|
file: ./test/Dockerfile
|
|
|
|
load: true
|
|
|
|
tags: ${{ steps.meta.outputs.tags }}
|
|
|
|
labels: ${{ steps.meta.outputs.labels }}
|
|
|
|
-
|
|
|
|
name: Build and push to local registry
|
|
|
|
uses: ./
|
|
|
|
with:
|
|
|
|
context: ./test
|
|
|
|
file: ./test/Dockerfile
|
|
|
|
push: ${{ github.event_name != 'pull_request' }}
|
|
|
|
tags: ${{ steps.meta.outputs.tags }}
|
|
|
|
labels: ${{ steps.meta.outputs.labels }}
|
|
|
|
-
|
|
|
|
name: Inspect image
|
|
|
|
run: |
|
|
|
|
docker image inspect ${{ env.DOCKER_IMAGE }}:${{ steps.meta.outputs.version }}
|
|
|
|
-
|
|
|
|
name: Check manifest
|
|
|
|
if: github.event_name != 'pull_request'
|
|
|
|
run: |
|
|
|
|
docker buildx imagetools inspect ${{ env.DOCKER_IMAGE }}:${{ steps.meta.outputs.version }} --format '{{json .}}'
|
|
|
|
|
2020-10-22 03:07:52 +08:00
|
|
|
error:
|
2021-04-27 22:16:22 +08:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
-
|
|
|
|
name: Checkout
|
2023-09-05 15:31:24 +08:00
|
|
|
uses: actions/checkout@v4
|
2021-04-27 22:16:22 +08:00
|
|
|
-
|
|
|
|
name: Stop docker
|
|
|
|
run: |
|
2023-09-05 15:26:58 +08:00
|
|
|
sudo systemctl stop docker docker.socket
|
2021-04-27 22:16:22 +08:00
|
|
|
-
|
|
|
|
name: Build
|
|
|
|
id: docker_build
|
|
|
|
continue-on-error: true
|
|
|
|
uses: ./
|
|
|
|
with:
|
|
|
|
context: ./test
|
|
|
|
file: ./test/Dockerfile
|
|
|
|
-
|
|
|
|
name: Check
|
|
|
|
run: |
|
|
|
|
echo "${{ toJson(steps.docker_build) }}"
|
|
|
|
if [ "${{ steps.docker_build.outcome }}" != "failure" ] || [ "${{ steps.docker_build.conclusion }}" != "success" ]; then
|
|
|
|
echo "::error::Should have failed"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
error-buildx:
|
2020-10-22 03:07:52 +08:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
-
|
|
|
|
name: Checkout
|
2023-09-05 15:31:24 +08:00
|
|
|
uses: actions/checkout@v4
|
2020-10-22 03:07:52 +08:00
|
|
|
-
|
|
|
|
name: Set up QEMU
|
2023-09-12 19:17:07 +08:00
|
|
|
uses: docker/setup-qemu-action@v3
|
2020-10-22 03:07:52 +08:00
|
|
|
-
|
|
|
|
name: Set up Docker Buildx
|
2023-09-12 19:17:11 +08:00
|
|
|
uses: docker/setup-buildx-action@v3
|
2022-08-12 22:45:35 +08:00
|
|
|
with:
|
2022-08-17 08:17:37 +08:00
|
|
|
version: ${{ inputs.buildx-version || env.BUILDX_VERSION }}
|
2022-08-12 22:45:35 +08:00
|
|
|
driver-opts: |
|
2022-08-17 08:17:37 +08:00
|
|
|
image=${{ inputs.buildkit-image || env.BUILDKIT_IMAGE }}
|
2020-10-22 03:07:52 +08:00
|
|
|
-
|
|
|
|
name: Build
|
2020-10-23 06:38:26 +08:00
|
|
|
id: docker_build
|
2020-10-22 03:07:52 +08:00
|
|
|
continue-on-error: true
|
|
|
|
uses: ./
|
|
|
|
with:
|
|
|
|
context: ./test
|
|
|
|
file: ./test/Dockerfile
|
|
|
|
platforms: linux/386,linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64,linux/ppc64le,linux/s390x
|
|
|
|
push: true
|
|
|
|
tags: localhost:5000/name/app:latest
|
2020-10-23 06:38:26 +08:00
|
|
|
-
|
|
|
|
name: Check
|
|
|
|
run: |
|
|
|
|
echo "${{ toJson(steps.docker_build) }}"
|
|
|
|
if [ "${{ steps.docker_build.outcome }}" != "failure" ] || [ "${{ steps.docker_build.conclusion }}" != "success" ]; then
|
|
|
|
echo "::error::Should have failed"
|
|
|
|
exit 1
|
|
|
|
fi
|
2020-10-22 03:07:52 +08:00
|
|
|
|
|
|
|
docker-driver:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
services:
|
|
|
|
registry:
|
|
|
|
image: registry:2
|
|
|
|
ports:
|
|
|
|
- 5000:5000
|
|
|
|
steps:
|
|
|
|
-
|
|
|
|
name: Checkout
|
2023-09-05 15:31:24 +08:00
|
|
|
uses: actions/checkout@v4
|
2020-10-22 03:07:52 +08:00
|
|
|
-
|
|
|
|
name: Build
|
2020-10-23 06:38:26 +08:00
|
|
|
id: docker_build
|
2020-10-22 03:07:52 +08:00
|
|
|
uses: ./
|
|
|
|
with:
|
|
|
|
context: ./test
|
|
|
|
file: ./test/Dockerfile
|
2021-01-16 02:21:19 +08:00
|
|
|
push: true
|
2020-10-22 03:07:52 +08:00
|
|
|
tags: localhost:5000/name/app:latest
|
|
|
|
|
2020-10-23 03:50:22 +08:00
|
|
|
export-docker:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
-
|
|
|
|
name: Checkout
|
2023-09-05 15:31:24 +08:00
|
|
|
uses: actions/checkout@v4
|
2020-10-23 03:50:22 +08:00
|
|
|
-
|
|
|
|
name: Build
|
|
|
|
uses: ./
|
|
|
|
with:
|
|
|
|
context: ./test
|
|
|
|
file: ./test/Dockerfile
|
|
|
|
load: true
|
|
|
|
tags: myimage:latest
|
|
|
|
-
|
|
|
|
name: Inspect
|
|
|
|
run: |
|
|
|
|
docker image inspect myimage:latest
|
|
|
|
|
2022-10-09 23:39:54 +08:00
|
|
|
secret:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
-
|
|
|
|
name: Checkout
|
2023-09-05 15:31:24 +08:00
|
|
|
uses: actions/checkout@v4
|
2022-10-09 23:39:54 +08:00
|
|
|
-
|
|
|
|
name: Set up Docker Buildx
|
2023-09-12 19:17:11 +08:00
|
|
|
uses: docker/setup-buildx-action@v3
|
2022-10-09 23:39:54 +08:00
|
|
|
with:
|
|
|
|
version: ${{ inputs.buildx-version || env.BUILDX_VERSION }}
|
|
|
|
driver-opts: |
|
|
|
|
image=${{ inputs.buildkit-image || env.BUILDKIT_IMAGE }}
|
|
|
|
-
|
|
|
|
name: Build
|
|
|
|
uses: ./
|
|
|
|
with:
|
|
|
|
context: .
|
|
|
|
file: ./test/secret.Dockerfile
|
|
|
|
secrets: |
|
|
|
|
MYSECRET=foo
|
|
|
|
INVALID_SECRET=
|
|
|
|
|
2023-10-12 20:32:49 +08:00
|
|
|
secret-envs:
|
2023-09-26 22:34:10 +08:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
-
|
|
|
|
name: Checkout
|
|
|
|
uses: actions/checkout@v4
|
|
|
|
-
|
|
|
|
name: Set up Docker buildx
|
|
|
|
uses: docker/setup-buildx-action@v3
|
|
|
|
with:
|
|
|
|
version: ${{ inputs.buildx-version || env.BUILDX_VERSION }}
|
|
|
|
driver-opts: |
|
|
|
|
image=${{ inputs.buildkit-image || env.BUILDKIT_IMAGE }}
|
|
|
|
-
|
|
|
|
name: Build
|
|
|
|
uses: ./
|
|
|
|
env:
|
|
|
|
ENV_SECRET: foo
|
|
|
|
with:
|
|
|
|
context: .
|
|
|
|
file: ./test/secret.Dockerfile
|
|
|
|
secret-envs: |
|
|
|
|
MYSECRET=ENV_SECRET
|
|
|
|
INVALID_SECRET=
|
|
|
|
|
2021-04-06 20:49:15 +08:00
|
|
|
network:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
-
|
|
|
|
name: Checkout
|
2023-09-05 15:31:24 +08:00
|
|
|
uses: actions/checkout@v4
|
2021-04-06 20:49:15 +08:00
|
|
|
-
|
|
|
|
name: Set up Docker Buildx
|
2023-09-12 19:17:11 +08:00
|
|
|
uses: docker/setup-buildx-action@v3
|
2022-08-12 22:45:35 +08:00
|
|
|
with:
|
2022-08-17 08:17:37 +08:00
|
|
|
version: ${{ inputs.buildx-version || env.BUILDX_VERSION }}
|
2022-08-12 22:45:35 +08:00
|
|
|
driver-opts: |
|
2022-08-17 08:17:37 +08:00
|
|
|
image=${{ inputs.buildkit-image || env.BUILDKIT_IMAGE }}
|
2021-04-06 20:49:15 +08:00
|
|
|
-
|
|
|
|
name: List networks
|
|
|
|
run: docker network ls
|
|
|
|
-
|
|
|
|
name: Build
|
|
|
|
uses: ./
|
|
|
|
with:
|
|
|
|
context: ./test
|
|
|
|
tags: name/app:latest
|
|
|
|
network: host
|
|
|
|
|
2021-11-16 14:19:27 +08:00
|
|
|
shm-size:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
-
|
|
|
|
name: Checkout
|
2023-09-05 15:31:24 +08:00
|
|
|
uses: actions/checkout@v4
|
2021-11-16 14:19:27 +08:00
|
|
|
-
|
|
|
|
name: Set up Docker Buildx
|
2023-09-12 19:17:11 +08:00
|
|
|
uses: docker/setup-buildx-action@v3
|
2021-11-16 14:19:27 +08:00
|
|
|
with:
|
2022-08-17 08:17:37 +08:00
|
|
|
version: ${{ inputs.buildx-version || env.BUILDX_VERSION }}
|
2021-11-16 14:19:27 +08:00
|
|
|
driver-opts: |
|
2022-08-17 08:17:37 +08:00
|
|
|
image=${{ inputs.buildkit-image || env.BUILDKIT_IMAGE }}
|
2021-11-16 14:19:27 +08:00
|
|
|
-
|
|
|
|
name: Build
|
|
|
|
uses: ./
|
|
|
|
with:
|
|
|
|
context: ./test
|
|
|
|
file: ./test/shmsize.Dockerfile
|
|
|
|
tags: name/app:latest
|
|
|
|
shm-size: 2g
|
|
|
|
|
|
|
|
ulimit:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
-
|
|
|
|
name: Checkout
|
2023-09-05 15:31:24 +08:00
|
|
|
uses: actions/checkout@v4
|
2021-11-16 14:19:27 +08:00
|
|
|
-
|
|
|
|
name: Set up Docker Buildx
|
2023-09-12 19:17:11 +08:00
|
|
|
uses: docker/setup-buildx-action@v3
|
2021-11-16 14:19:27 +08:00
|
|
|
with:
|
2022-08-17 08:17:37 +08:00
|
|
|
version: ${{ inputs.buildx-version || env.BUILDX_VERSION }}
|
2021-11-16 14:19:27 +08:00
|
|
|
driver-opts: |
|
2022-08-12 22:45:35 +08:00
|
|
|
network=host
|
2022-08-17 08:17:37 +08:00
|
|
|
image=${{ inputs.buildkit-image || env.BUILDKIT_IMAGE }}
|
2021-11-16 14:19:27 +08:00
|
|
|
-
|
|
|
|
name: Build
|
|
|
|
uses: ./
|
|
|
|
with:
|
|
|
|
context: ./test
|
|
|
|
file: ./test/ulimit.Dockerfile
|
|
|
|
tags: name/app:latest
|
|
|
|
ulimit: |
|
|
|
|
nofile=1024:1024
|
|
|
|
nproc=3
|
|
|
|
|
|
|
|
cgroup-parent:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
-
|
|
|
|
name: Checkout
|
2023-09-05 15:31:24 +08:00
|
|
|
uses: actions/checkout@v4
|
2021-11-16 14:19:27 +08:00
|
|
|
-
|
|
|
|
name: Set up Docker Buildx
|
2023-09-12 19:17:11 +08:00
|
|
|
uses: docker/setup-buildx-action@v3
|
2021-11-16 14:19:27 +08:00
|
|
|
with:
|
2022-08-17 08:17:37 +08:00
|
|
|
version: ${{ inputs.buildx-version || env.BUILDX_VERSION }}
|
2021-11-16 14:19:27 +08:00
|
|
|
driver-opts: |
|
2022-08-12 22:45:35 +08:00
|
|
|
network=host
|
2022-08-17 08:17:37 +08:00
|
|
|
image=${{ inputs.buildkit-image || env.BUILDKIT_IMAGE }}
|
2021-11-16 14:19:27 +08:00
|
|
|
-
|
|
|
|
name: Build
|
|
|
|
uses: ./
|
|
|
|
with:
|
|
|
|
context: ./test
|
|
|
|
file: ./test/cgroup.Dockerfile
|
|
|
|
tags: name/app:latest
|
|
|
|
cgroup-parent: foo
|
|
|
|
|
2022-01-31 18:47:45 +08:00
|
|
|
add-hosts:
|
2022-01-31 01:33:31 +08:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
-
|
|
|
|
name: Checkout
|
2023-09-05 15:31:24 +08:00
|
|
|
uses: actions/checkout@v4
|
2022-01-31 01:33:31 +08:00
|
|
|
-
|
|
|
|
name: Set up Docker Buildx
|
2023-09-12 19:17:11 +08:00
|
|
|
uses: docker/setup-buildx-action@v3
|
2022-08-12 22:45:35 +08:00
|
|
|
with:
|
2022-08-17 08:17:37 +08:00
|
|
|
version: ${{ inputs.buildx-version || env.BUILDX_VERSION }}
|
2022-08-12 22:45:35 +08:00
|
|
|
driver-opts: |
|
|
|
|
network=host
|
2022-08-17 08:17:37 +08:00
|
|
|
image=${{ inputs.buildkit-image || env.BUILDKIT_IMAGE }}
|
2022-01-31 01:33:31 +08:00
|
|
|
-
|
|
|
|
name: Build
|
|
|
|
uses: ./
|
|
|
|
with:
|
|
|
|
context: ./test
|
|
|
|
file: ./test/addhost.Dockerfile
|
|
|
|
tags: name/app:latest
|
2022-01-31 18:47:45 +08:00
|
|
|
add-hosts: |
|
2022-01-31 01:33:31 +08:00
|
|
|
docker:10.180.0.1
|
|
|
|
foo:10.0.0.1
|
|
|
|
|
2022-07-18 23:24:11 +08:00
|
|
|
no-cache-filters:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
-
|
|
|
|
name: Checkout
|
2023-09-05 15:31:24 +08:00
|
|
|
uses: actions/checkout@v4
|
2022-07-18 23:24:11 +08:00
|
|
|
-
|
|
|
|
name: Set up Docker Buildx
|
2023-09-12 19:17:11 +08:00
|
|
|
uses: docker/setup-buildx-action@v3
|
2022-08-12 22:45:35 +08:00
|
|
|
with:
|
2022-08-17 08:17:37 +08:00
|
|
|
version: ${{ inputs.buildx-version || env.BUILDX_VERSION }}
|
2022-08-12 22:45:35 +08:00
|
|
|
driver-opts: |
|
2022-08-17 08:17:37 +08:00
|
|
|
image=${{ inputs.buildkit-image || env.BUILDKIT_IMAGE }}
|
2022-07-18 23:24:11 +08:00
|
|
|
-
|
|
|
|
name: Build
|
|
|
|
uses: ./
|
|
|
|
with:
|
|
|
|
context: ./test
|
|
|
|
file: ./test/nocachefilter.Dockerfile
|
|
|
|
no-cache-filters: build
|
|
|
|
tags: name/app:latest
|
|
|
|
cache-from: type=gha,scope=nocachefilter
|
|
|
|
cache-to: type=gha,scope=nocachefilter,mode=max
|
|
|
|
|
2023-01-11 19:10:34 +08:00
|
|
|
attests-compat:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
|
|
|
include:
|
|
|
|
- buildx: latest
|
|
|
|
buildkit: moby/buildkit:buildx-stable-1
|
|
|
|
- buildx: latest
|
|
|
|
buildkit: moby/buildkit:v0.10.6
|
|
|
|
- buildx: v0.9.1
|
|
|
|
buildkit: moby/buildkit:buildx-stable-1
|
|
|
|
steps:
|
|
|
|
-
|
|
|
|
name: Checkout
|
2023-09-05 15:31:24 +08:00
|
|
|
uses: actions/checkout@v4
|
2023-01-11 19:10:34 +08:00
|
|
|
-
|
|
|
|
name: Set up Docker Buildx
|
2023-09-12 19:17:11 +08:00
|
|
|
uses: docker/setup-buildx-action@v3
|
2023-01-11 19:10:34 +08:00
|
|
|
with:
|
|
|
|
version: ${{ matrix.buildx }}
|
|
|
|
driver-opts: |
|
|
|
|
network=host
|
|
|
|
image=${{ matrix.buildkit }}
|
|
|
|
-
|
|
|
|
name: Build
|
|
|
|
uses: ./
|
|
|
|
with:
|
|
|
|
context: ./test/go
|
|
|
|
file: ./test/go/Dockerfile
|
|
|
|
outputs: type=cacheonly
|
|
|
|
|
2023-01-13 17:02:50 +08:00
|
|
|
provenance:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
2023-11-17 18:34:55 +08:00
|
|
|
include:
|
|
|
|
- target: image
|
|
|
|
output: type=image,name=localhost:5000/name/app:latest,push=true
|
|
|
|
attr: mode=max
|
|
|
|
- target: image
|
|
|
|
output: type=image,name=localhost:5000/name/app:latest,push=true
|
|
|
|
attr: ''
|
|
|
|
- target: binary
|
|
|
|
output: /tmp/buildx-build
|
|
|
|
attr: mode=max
|
|
|
|
- target: binary
|
|
|
|
output: /tmp/buildx-build
|
|
|
|
attr: ''
|
|
|
|
services:
|
|
|
|
registry:
|
|
|
|
image: registry:2
|
|
|
|
ports:
|
|
|
|
- 5000:5000
|
2023-01-13 17:02:50 +08:00
|
|
|
steps:
|
|
|
|
-
|
|
|
|
name: Checkout
|
2023-09-05 15:31:24 +08:00
|
|
|
uses: actions/checkout@v4
|
2023-01-13 17:02:50 +08:00
|
|
|
-
|
|
|
|
name: Set up Docker Buildx
|
2023-09-12 19:17:11 +08:00
|
|
|
uses: docker/setup-buildx-action@v3
|
2023-01-13 17:02:50 +08:00
|
|
|
with:
|
|
|
|
version: ${{ inputs.buildx-version || env.BUILDX_VERSION }}
|
|
|
|
driver-opts: |
|
|
|
|
network=host
|
|
|
|
image=${{ inputs.buildkit-image || env.BUILDKIT_IMAGE }}
|
|
|
|
-
|
|
|
|
name: Build
|
|
|
|
uses: ./
|
|
|
|
with:
|
|
|
|
context: ./test/go
|
|
|
|
file: ./test/go/Dockerfile
|
2023-11-17 18:34:55 +08:00
|
|
|
target: ${{ matrix.target }}
|
|
|
|
outputs: ${{ matrix.output }}
|
|
|
|
provenance: ${{ matrix.attr }}
|
|
|
|
-
|
|
|
|
name: Inspect Provenance
|
|
|
|
if: matrix.target == 'image'
|
|
|
|
run: |
|
|
|
|
docker buildx imagetools inspect localhost:5000/name/app:latest --format '{{json .Provenance}}'
|
|
|
|
-
|
|
|
|
name: Check output folder
|
|
|
|
if: matrix.target == 'binary'
|
|
|
|
run: |
|
|
|
|
tree /tmp/buildx-build
|
|
|
|
-
|
|
|
|
name: Print local Provenance
|
|
|
|
if: matrix.target == 'binary'
|
|
|
|
run: |
|
|
|
|
cat /tmp/buildx-build/provenance.json | jq
|
2023-01-13 17:02:50 +08:00
|
|
|
|
2023-01-11 19:10:34 +08:00
|
|
|
sbom:
|
2023-01-11 19:12:09 +08:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
|
|
|
include:
|
|
|
|
- target: image
|
|
|
|
output: type=image,name=localhost:5000/name/app:latest,push=true
|
|
|
|
- target: binary
|
|
|
|
output: /tmp/buildx-build
|
|
|
|
services:
|
|
|
|
registry:
|
|
|
|
image: registry:2
|
|
|
|
ports:
|
|
|
|
- 5000:5000
|
|
|
|
steps:
|
|
|
|
-
|
|
|
|
name: Checkout
|
2023-09-05 15:31:24 +08:00
|
|
|
uses: actions/checkout@v4
|
2023-01-11 19:12:09 +08:00
|
|
|
-
|
|
|
|
name: Set up Docker Buildx
|
2023-09-12 19:17:11 +08:00
|
|
|
uses: docker/setup-buildx-action@v3
|
2023-01-11 19:12:09 +08:00
|
|
|
with:
|
|
|
|
version: ${{ inputs.buildx-version || env.BUILDX_VERSION }}
|
|
|
|
driver-opts: |
|
|
|
|
network=host
|
|
|
|
image=${{ inputs.buildkit-image || env.BUILDKIT_IMAGE }}
|
|
|
|
-
|
|
|
|
name: Build
|
|
|
|
uses: ./
|
|
|
|
with:
|
|
|
|
context: ./test/go
|
|
|
|
file: ./test/go/Dockerfile
|
|
|
|
target: ${{ matrix.target }}
|
|
|
|
outputs: ${{ matrix.output }}
|
2022-12-20 13:17:29 +08:00
|
|
|
sbom: true
|
2023-01-11 19:12:09 +08:00
|
|
|
cache-from: type=gha,scope=attests-${{ matrix.target }}
|
|
|
|
cache-to: type=gha,scope=attests-${{ matrix.target }},mode=max
|
|
|
|
-
|
2023-11-17 18:34:55 +08:00
|
|
|
name: Inspect SBOM
|
2023-01-11 19:12:09 +08:00
|
|
|
if: matrix.target == 'image'
|
|
|
|
run: |
|
2023-11-17 18:34:55 +08:00
|
|
|
docker buildx imagetools inspect localhost:5000/name/app:latest --format '{{json .SBOM}}'
|
2023-01-11 19:12:09 +08:00
|
|
|
-
|
|
|
|
name: Check output folder
|
|
|
|
if: matrix.target == 'binary'
|
|
|
|
run: |
|
|
|
|
tree /tmp/buildx-build
|
2023-01-31 02:21:25 +08:00
|
|
|
-
|
2023-11-17 18:34:55 +08:00
|
|
|
name: Print local SBOM
|
2023-01-11 19:12:09 +08:00
|
|
|
if: matrix.target == 'binary'
|
|
|
|
run: |
|
|
|
|
cat /tmp/buildx-build/sbom.spdx.json | jq
|
|
|
|
|
2020-09-02 16:07:11 +08:00
|
|
|
multi:
|
2020-08-29 22:10:05 +08:00
|
|
|
runs-on: ubuntu-latest
|
2020-09-02 16:07:11 +08:00
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
|
|
|
dockerfile:
|
|
|
|
- multi
|
|
|
|
- multi-sudo
|
2020-09-05 11:18:15 +08:00
|
|
|
services:
|
|
|
|
registry:
|
|
|
|
image: registry:2
|
|
|
|
ports:
|
|
|
|
- 5000:5000
|
2020-08-29 22:10:05 +08:00
|
|
|
steps:
|
|
|
|
-
|
|
|
|
name: Checkout
|
2023-09-05 15:31:24 +08:00
|
|
|
uses: actions/checkout@v4
|
2020-08-29 22:10:05 +08:00
|
|
|
-
|
|
|
|
name: Set up QEMU
|
2023-09-12 19:17:07 +08:00
|
|
|
uses: docker/setup-qemu-action@v3
|
2020-08-29 22:10:05 +08:00
|
|
|
-
|
|
|
|
name: Set up Docker Buildx
|
|
|
|
id: buildx
|
2023-09-12 19:17:11 +08:00
|
|
|
uses: docker/setup-buildx-action@v3
|
2020-08-29 22:10:05 +08:00
|
|
|
with:
|
2022-08-17 08:17:37 +08:00
|
|
|
version: ${{ inputs.buildx-version || env.BUILDX_VERSION }}
|
2022-08-12 22:45:35 +08:00
|
|
|
driver-opts: |
|
|
|
|
network=host
|
2022-08-17 08:17:37 +08:00
|
|
|
image=${{ inputs.buildkit-image || env.BUILDKIT_IMAGE }}
|
2020-08-29 22:10:05 +08:00
|
|
|
-
|
|
|
|
name: Build and push
|
|
|
|
id: docker_build
|
|
|
|
uses: ./
|
|
|
|
with:
|
|
|
|
context: ./test
|
2021-03-28 22:43:51 +08:00
|
|
|
file: ./test/${{ matrix.dockerfile }}.Dockerfile
|
2020-08-29 22:10:05 +08:00
|
|
|
builder: ${{ steps.buildx.outputs.name }}
|
|
|
|
platforms: linux/amd64,linux/arm64
|
|
|
|
push: true
|
|
|
|
tags: |
|
|
|
|
localhost:5000/name/app:latest
|
|
|
|
localhost:5000/name/app:1.0.0
|
|
|
|
-
|
|
|
|
name: Inspect
|
|
|
|
run: |
|
2023-01-11 21:03:02 +08:00
|
|
|
docker buildx imagetools inspect localhost:5000/name/app:1.0.0 --format '{{json .}}'
|
2020-10-21 15:51:06 +08:00
|
|
|
-
|
|
|
|
name: Check digest
|
|
|
|
run: |
|
|
|
|
if [ -z "${{ steps.docker_build.outputs.digest }}" ]; then
|
|
|
|
echo "::error::Digest should not be empty"
|
|
|
|
exit 1
|
|
|
|
fi
|
2022-03-15 02:30:50 +08:00
|
|
|
|
|
|
|
digest:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
env:
|
|
|
|
DOCKER_IMAGE: localhost:5000/name/app
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
|
|
|
driver:
|
|
|
|
- docker
|
|
|
|
- docker-container
|
|
|
|
load:
|
|
|
|
- true
|
|
|
|
- false
|
|
|
|
push:
|
|
|
|
- true
|
|
|
|
- false
|
|
|
|
exclude:
|
|
|
|
- driver: docker
|
|
|
|
load: true
|
|
|
|
push: true
|
|
|
|
- driver: docker-container
|
|
|
|
load: true
|
|
|
|
push: true
|
|
|
|
services:
|
|
|
|
registry:
|
|
|
|
image: registry:2
|
|
|
|
ports:
|
|
|
|
- 5000:5000
|
|
|
|
steps:
|
|
|
|
-
|
|
|
|
name: Checkout
|
2023-09-05 15:31:24 +08:00
|
|
|
uses: actions/checkout@v4
|
2020-08-29 22:10:05 +08:00
|
|
|
-
|
2022-03-15 02:30:50 +08:00
|
|
|
name: Set up Docker Buildx
|
2023-09-12 19:17:11 +08:00
|
|
|
uses: docker/setup-buildx-action@v3
|
2022-03-15 02:30:50 +08:00
|
|
|
with:
|
2022-08-17 08:17:37 +08:00
|
|
|
version: ${{ inputs.buildx-version || env.BUILDX_VERSION }}
|
2022-03-15 02:30:50 +08:00
|
|
|
driver: ${{ matrix.driver }}
|
|
|
|
driver-opts: |
|
|
|
|
network=host
|
|
|
|
-
|
|
|
|
name: Build
|
|
|
|
id: docker_build
|
|
|
|
uses: ./
|
|
|
|
with:
|
|
|
|
context: ./test
|
|
|
|
load: ${{ matrix.load }}
|
|
|
|
push: ${{ matrix.push }}
|
|
|
|
tags: ${{ env.DOCKER_IMAGE }}:latest
|
|
|
|
platforms: ${{ matrix.platforms }}
|
|
|
|
-
|
|
|
|
name: Docker images
|
|
|
|
run: |
|
|
|
|
docker image ls --no-trunc
|
|
|
|
-
|
|
|
|
name: Check digest
|
|
|
|
run: |
|
2023-08-11 17:52:26 +08:00
|
|
|
if [[ "${{ matrix.driver }}" = "docker-container" ]] && [[ "${{ matrix.load }}" = "false" ]] && [[ "${{ matrix.push }}" = "false" ]]; then
|
|
|
|
if [ -n "${{ steps.docker_build.outputs.digest }}" ]; then
|
|
|
|
echo "::error::Digest should be empty"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
elif [[ "${{ matrix.push }}" = "true" ]] && [[ -z "${{ steps.docker_build.outputs.digest }}" ]]; then
|
2022-03-15 02:30:50 +08:00
|
|
|
echo "::error::Digest should not be empty"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
-
|
|
|
|
name: Check manifest
|
|
|
|
if: ${{ matrix.push }}
|
|
|
|
run: |
|
|
|
|
set -x
|
|
|
|
docker buildx imagetools inspect ${{ env.DOCKER_IMAGE }}@${{ steps.docker_build.outputs.digest }} --format '{{json .}}'
|
|
|
|
-
|
|
|
|
name: Check image ID
|
|
|
|
run: |
|
2023-08-11 17:52:26 +08:00
|
|
|
if [[ "${{ matrix.driver }}" = "docker-container" ]] && [[ "${{ matrix.load }}" = "false" ]] && [[ "${{ matrix.push }}" = "false" ]]; then
|
|
|
|
if [ -n "${{ steps.docker_build.outputs.imageid }}" ]; then
|
|
|
|
echo "::error::Image ID should be empty"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
elif [ -z "${{ steps.docker_build.outputs.imageid }}" ]; then
|
2022-03-15 02:30:50 +08:00
|
|
|
echo "::error::Image ID should not be empty"
|
|
|
|
exit 1
|
|
|
|
fi
|
2020-08-29 22:10:05 +08:00
|
|
|
-
|
2022-03-15 02:30:50 +08:00
|
|
|
name: Inspect image
|
|
|
|
if: ${{ matrix.load }}
|
|
|
|
run: |
|
|
|
|
set -x
|
|
|
|
docker image inspect ${{ steps.docker_build.outputs.imageid }}
|
2020-08-29 22:10:05 +08:00
|
|
|
|
2020-10-04 06:01:14 +08:00
|
|
|
registry-cache:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
services:
|
|
|
|
registry:
|
|
|
|
image: registry:2
|
|
|
|
ports:
|
|
|
|
- 5000:5000
|
|
|
|
steps:
|
|
|
|
-
|
|
|
|
name: Checkout
|
2023-09-05 15:31:24 +08:00
|
|
|
uses: actions/checkout@v4
|
2020-10-04 06:01:14 +08:00
|
|
|
-
|
|
|
|
name: Set up QEMU
|
2023-09-12 19:17:07 +08:00
|
|
|
uses: docker/setup-qemu-action@v3
|
2020-10-04 06:01:14 +08:00
|
|
|
-
|
|
|
|
name: Set up Docker Buildx
|
2023-09-12 19:17:11 +08:00
|
|
|
uses: docker/setup-buildx-action@v3
|
2020-10-04 06:01:14 +08:00
|
|
|
with:
|
2022-08-17 08:17:37 +08:00
|
|
|
version: ${{ inputs.buildx-version || env.BUILDX_VERSION }}
|
2020-10-12 01:17:08 +08:00
|
|
|
driver-opts: |
|
|
|
|
network=host
|
2022-08-17 08:17:37 +08:00
|
|
|
image=${{ inputs.buildkit-image || env.BUILDKIT_IMAGE }}
|
2020-10-04 06:01:14 +08:00
|
|
|
-
|
2023-01-11 21:32:33 +08:00
|
|
|
name: Build and push
|
2020-10-04 06:01:14 +08:00
|
|
|
id: docker_build
|
|
|
|
uses: ./
|
|
|
|
with:
|
|
|
|
context: ./test
|
2021-03-28 22:43:51 +08:00
|
|
|
file: ./test/multi.Dockerfile
|
2020-10-04 06:01:14 +08:00
|
|
|
builder: ${{ steps.buildx.outputs.name }}
|
|
|
|
platforms: linux/amd64,linux/arm64
|
|
|
|
push: true
|
|
|
|
tags: |
|
|
|
|
localhost:5000/name/app:latest
|
|
|
|
localhost:5000/name/app:1.0.0
|
2020-10-04 07:10:42 +08:00
|
|
|
cache-from: type=registry,ref=localhost:5000/name/app
|
|
|
|
cache-to: type=inline
|
2020-10-04 06:01:14 +08:00
|
|
|
-
|
2023-01-11 21:32:33 +08:00
|
|
|
name: Inspect
|
2020-10-04 06:01:14 +08:00
|
|
|
run: |
|
2023-01-11 21:03:02 +08:00
|
|
|
docker buildx imagetools inspect localhost:5000/name/app:latest --format '{{json .}}'
|
2020-10-21 15:51:06 +08:00
|
|
|
-
|
2023-01-11 21:32:33 +08:00
|
|
|
name: Check digest
|
2020-10-21 15:51:06 +08:00
|
|
|
run: |
|
|
|
|
if [ -z "${{ steps.docker_build.outputs.digest }}" ]; then
|
|
|
|
echo "::error::Digest should not be empty"
|
|
|
|
exit 1
|
|
|
|
fi
|
2020-10-04 06:01:14 +08:00
|
|
|
|
2021-07-29 22:57:22 +08:00
|
|
|
github-cache:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
services:
|
|
|
|
registry:
|
|
|
|
image: registry:2
|
|
|
|
ports:
|
|
|
|
- 5000:5000
|
|
|
|
steps:
|
|
|
|
-
|
|
|
|
name: Checkout
|
2023-09-05 15:31:24 +08:00
|
|
|
uses: actions/checkout@v4
|
2021-07-29 22:57:22 +08:00
|
|
|
-
|
|
|
|
name: Set up QEMU
|
2023-09-12 19:17:07 +08:00
|
|
|
uses: docker/setup-qemu-action@v3
|
2021-07-29 22:57:22 +08:00
|
|
|
-
|
|
|
|
name: Set up Docker Buildx
|
2023-09-12 19:17:11 +08:00
|
|
|
uses: docker/setup-buildx-action@v3
|
2021-07-29 22:57:22 +08:00
|
|
|
with:
|
2022-08-17 08:17:37 +08:00
|
|
|
version: ${{ inputs.buildx-version || env.BUILDX_VERSION }}
|
2021-07-29 22:57:22 +08:00
|
|
|
driver-opts: |
|
|
|
|
network=host
|
2022-08-17 08:17:37 +08:00
|
|
|
image=${{ inputs.buildkit-image || env.BUILDKIT_IMAGE }}
|
2021-07-29 22:57:22 +08:00
|
|
|
buildkitd-flags: --debug
|
|
|
|
-
|
|
|
|
name: Build and push
|
|
|
|
uses: ./
|
|
|
|
with:
|
|
|
|
context: ./test
|
|
|
|
file: ./test/multi.Dockerfile
|
|
|
|
platforms: linux/amd64,linux/arm64
|
|
|
|
push: true
|
|
|
|
tags: |
|
|
|
|
localhost:5000/name/app:latest
|
|
|
|
localhost:5000/name/app:1.0.0
|
|
|
|
cache-from: type=gha,scope=ci-${{ matrix.buildx_version }}
|
|
|
|
cache-to: type=gha,scope=ci-${{ matrix.buildx_version }}
|
|
|
|
-
|
|
|
|
name: Inspect
|
|
|
|
run: |
|
2023-01-11 21:03:02 +08:00
|
|
|
docker buildx imagetools inspect localhost:5000/name/app:1.0.0 --format '{{json .}}'
|
2022-04-28 15:31:47 +08:00
|
|
|
|
2024-02-28 22:43:21 +08:00
|
|
|
local-cache:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
services:
|
|
|
|
registry:
|
|
|
|
image: registry:2
|
|
|
|
ports:
|
|
|
|
- 5000:5000
|
|
|
|
steps:
|
|
|
|
-
|
|
|
|
name: Checkout
|
|
|
|
uses: actions/checkout@v4
|
|
|
|
-
|
|
|
|
name: Set up QEMU
|
|
|
|
uses: docker/setup-qemu-action@v3
|
|
|
|
-
|
|
|
|
name: Set up Docker Buildx
|
|
|
|
uses: docker/setup-buildx-action@v3
|
|
|
|
with:
|
|
|
|
version: ${{ inputs.buildx-version || env.BUILDX_VERSION }}
|
|
|
|
driver-opts: |
|
|
|
|
network=host
|
|
|
|
image=${{ inputs.buildkit-image || env.BUILDKIT_IMAGE }}
|
|
|
|
buildkitd-flags: --debug
|
|
|
|
-
|
|
|
|
name: Cache Build
|
|
|
|
uses: actions/cache@v4
|
|
|
|
with:
|
|
|
|
path: /tmp/.buildx-cache
|
|
|
|
key: ${{ runner.os }}-local-test-${{ github.sha }}
|
|
|
|
restore-keys: |
|
|
|
|
${{ runner.os }}-local-test-
|
|
|
|
-
|
|
|
|
name: Build and push
|
|
|
|
uses: ./
|
|
|
|
with:
|
|
|
|
context: ./test
|
|
|
|
file: ./test/multi.Dockerfile
|
|
|
|
platforms: linux/amd64,linux/arm64
|
|
|
|
push: true
|
|
|
|
tags: |
|
|
|
|
localhost:5000/name/app:latest
|
|
|
|
localhost:5000/name/app:1.0.0
|
|
|
|
cache-from: type=local,src=/tmp/.buildx-cache
|
|
|
|
cache-to: type=local,dest=/tmp/.buildx-cache-new
|
|
|
|
-
|
|
|
|
name: Inspect
|
|
|
|
run: |
|
|
|
|
docker buildx imagetools inspect localhost:5000/name/app:1.0.0 --format '{{json .}}'
|
|
|
|
-
|
|
|
|
# Temp fix
|
|
|
|
# https://github.com/docker/build-push-action/issues/252
|
|
|
|
# https://github.com/moby/buildkit/issues/1896
|
|
|
|
name: Move cache
|
|
|
|
run: |
|
|
|
|
rm -rf /tmp/.buildx-cache
|
|
|
|
mv /tmp/.buildx-cache-new /tmp/.buildx-cache
|
|
|
|
|
2022-04-28 15:31:47 +08:00
|
|
|
standalone:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
-
|
|
|
|
name: Checkout
|
2023-09-05 15:31:24 +08:00
|
|
|
uses: actions/checkout@v4
|
2022-04-28 15:31:47 +08:00
|
|
|
-
|
2023-09-05 15:26:58 +08:00
|
|
|
name: Uninstall docker cli
|
2022-04-28 15:31:47 +08:00
|
|
|
run: |
|
2023-09-05 15:26:58 +08:00
|
|
|
if dpkg -s "docker-ce" >/dev/null 2>&1; then
|
|
|
|
sudo dpkg -r --force-depends docker-ce-cli docker-buildx-plugin
|
|
|
|
else
|
|
|
|
sudo apt-get purge -y moby-cli moby-buildx
|
|
|
|
fi
|
2022-04-28 15:31:47 +08:00
|
|
|
-
|
|
|
|
name: Set up Docker Buildx
|
2023-09-12 19:17:11 +08:00
|
|
|
uses: docker/setup-buildx-action@v3
|
2022-08-12 22:45:35 +08:00
|
|
|
with:
|
2022-08-17 08:17:37 +08:00
|
|
|
version: ${{ inputs.buildx-version || env.BUILDX_VERSION }}
|
2022-08-12 22:45:35 +08:00
|
|
|
driver-opts: |
|
|
|
|
network=host
|
2022-08-17 08:17:37 +08:00
|
|
|
image=${{ inputs.buildkit-image || env.BUILDKIT_IMAGE }}
|
2022-04-28 15:31:47 +08:00
|
|
|
-
|
|
|
|
name: Build
|
|
|
|
uses: ./
|
|
|
|
with:
|
|
|
|
context: ./test
|
|
|
|
file: ./test/Dockerfile
|
2023-02-23 21:02:47 +08:00
|
|
|
|
|
|
|
named-context-pin:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
-
|
|
|
|
name: Checkout
|
2023-09-05 15:31:24 +08:00
|
|
|
uses: actions/checkout@v4
|
2023-02-23 21:02:47 +08:00
|
|
|
-
|
|
|
|
name: Set up Docker Buildx
|
2023-09-12 19:17:11 +08:00
|
|
|
uses: docker/setup-buildx-action@v3
|
2023-02-23 21:02:47 +08:00
|
|
|
with:
|
|
|
|
version: ${{ inputs.buildx-version || env.BUILDX_VERSION }}
|
|
|
|
driver-opts: |
|
|
|
|
image=${{ inputs.buildkit-image || env.BUILDKIT_IMAGE }}
|
|
|
|
-
|
|
|
|
name: Build base image
|
|
|
|
uses: ./
|
|
|
|
with:
|
|
|
|
context: ./test
|
|
|
|
file: ./test/named-context.Dockerfile
|
|
|
|
build-contexts: |
|
|
|
|
alpine=docker-image://alpine:edge
|
|
|
|
|
|
|
|
named-context-docker:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
-
|
|
|
|
name: Checkout
|
2023-09-05 15:31:24 +08:00
|
|
|
uses: actions/checkout@v4
|
2023-02-23 21:02:47 +08:00
|
|
|
-
|
|
|
|
name: Set up Docker Buildx
|
2023-09-12 19:17:11 +08:00
|
|
|
uses: docker/setup-buildx-action@v3
|
2023-02-23 21:02:47 +08:00
|
|
|
with:
|
|
|
|
version: ${{ inputs.buildx-version || env.BUILDX_VERSION }}
|
|
|
|
driver: docker
|
|
|
|
-
|
|
|
|
name: Build base image
|
|
|
|
uses: ./
|
|
|
|
with:
|
|
|
|
context: ./test
|
|
|
|
file: ./test/named-context-base.Dockerfile
|
|
|
|
load: true
|
|
|
|
tags: my-base-image:local
|
|
|
|
-
|
|
|
|
name: Build
|
|
|
|
uses: ./
|
|
|
|
with:
|
|
|
|
context: ./test
|
|
|
|
file: ./test/named-context.Dockerfile
|
|
|
|
build-contexts: |
|
|
|
|
base=docker-image://my-base-image:local
|
|
|
|
|
|
|
|
named-context-container:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
services:
|
|
|
|
registry:
|
|
|
|
image: registry:2
|
|
|
|
ports:
|
|
|
|
- 5000:5000
|
|
|
|
steps:
|
|
|
|
-
|
|
|
|
name: Checkout
|
2023-09-05 15:31:24 +08:00
|
|
|
uses: actions/checkout@v4
|
2023-02-23 21:02:47 +08:00
|
|
|
-
|
|
|
|
name: Set up Docker Buildx
|
2023-09-12 19:17:11 +08:00
|
|
|
uses: docker/setup-buildx-action@v3
|
2023-02-23 21:02:47 +08:00
|
|
|
with:
|
|
|
|
version: ${{ inputs.buildx-version || env.BUILDX_VERSION }}
|
|
|
|
driver-opts: |
|
|
|
|
image=${{ inputs.buildkit-image || env.BUILDKIT_IMAGE }}
|
|
|
|
network=host
|
|
|
|
-
|
|
|
|
name: Build base image
|
|
|
|
uses: ./
|
|
|
|
with:
|
|
|
|
context: ./test
|
|
|
|
file: ./test/named-context-base.Dockerfile
|
|
|
|
tags: localhost:5000/my-base-image:latest
|
|
|
|
push: true
|
|
|
|
-
|
|
|
|
name: Build
|
|
|
|
uses: ./
|
|
|
|
with:
|
|
|
|
context: ./test
|
|
|
|
file: ./test/named-context.Dockerfile
|
|
|
|
build-contexts: |
|
|
|
|
alpine=docker-image://localhost:5000/my-base-image:latest
|
2023-06-05 17:35:09 +08:00
|
|
|
|
2023-09-08 21:28:08 +08:00
|
|
|
docker-config-malformed:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
-
|
|
|
|
name: Checkout
|
|
|
|
uses: actions/checkout@v4
|
|
|
|
-
|
|
|
|
name: Set malformed docker config
|
|
|
|
run: |
|
|
|
|
mkdir -p ~/.docker
|
|
|
|
echo 'foo_bar' >> ~/.docker/config.json
|
|
|
|
-
|
|
|
|
name: Build
|
|
|
|
uses: ./
|
|
|
|
with:
|
|
|
|
context: ./test
|
|
|
|
|
2023-06-05 17:35:09 +08:00
|
|
|
proxy-docker-config:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
services:
|
|
|
|
squid-proxy:
|
|
|
|
image: ubuntu/squid:latest
|
|
|
|
ports:
|
|
|
|
- 3128:3128
|
|
|
|
steps:
|
|
|
|
-
|
|
|
|
name: Check proxy
|
|
|
|
run: |
|
|
|
|
netstat -aptn
|
|
|
|
curl --retry 5 --retry-all-errors --retry-delay 0 --connect-timeout 5 --proxy http://127.0.0.1:3128 -v --insecure --head https://www.google.com
|
|
|
|
-
|
|
|
|
name: Checkout
|
2023-09-05 15:31:24 +08:00
|
|
|
uses: actions/checkout@v4
|
2023-06-05 17:35:09 +08:00
|
|
|
-
|
|
|
|
name: Set proxy config
|
|
|
|
run: |
|
|
|
|
mkdir -p ~/.docker
|
|
|
|
echo '{"proxies":{"default":{"httpProxy":"http://127.0.0.1:3128","httpsProxy":"http://127.0.0.1:3128"}}}' > ~/.docker/config.json
|
|
|
|
-
|
|
|
|
name: Set up Docker Buildx
|
2023-09-12 19:17:11 +08:00
|
|
|
uses: docker/setup-buildx-action@v3
|
2023-06-05 17:35:09 +08:00
|
|
|
with:
|
|
|
|
version: ${{ inputs.buildx-version || env.BUILDX_VERSION }}
|
|
|
|
driver-opts: |
|
|
|
|
image=${{ inputs.buildkit-image || env.BUILDKIT_IMAGE }}
|
|
|
|
network=host
|
|
|
|
buildkitd-flags: --debug
|
|
|
|
-
|
|
|
|
name: Build
|
|
|
|
uses: ./
|
|
|
|
with:
|
|
|
|
context: ./test
|
|
|
|
file: ./test/proxy.Dockerfile
|
|
|
|
|
|
|
|
proxy-buildkitd:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
services:
|
|
|
|
squid-proxy:
|
|
|
|
image: ubuntu/squid:latest
|
|
|
|
ports:
|
|
|
|
- 3128:3128
|
|
|
|
steps:
|
|
|
|
-
|
|
|
|
name: Check proxy
|
|
|
|
run: |
|
|
|
|
netstat -aptn
|
|
|
|
curl --retry 5 --retry-all-errors --retry-delay 0 --connect-timeout 5 --proxy http://127.0.0.1:3128 -v --insecure --head https://www.google.com
|
|
|
|
-
|
|
|
|
name: Checkout
|
2023-09-05 15:31:24 +08:00
|
|
|
uses: actions/checkout@v4
|
2023-06-05 17:35:09 +08:00
|
|
|
-
|
|
|
|
name: Set up Docker Buildx
|
2023-09-12 19:17:11 +08:00
|
|
|
uses: docker/setup-buildx-action@v3
|
2023-06-05 17:35:09 +08:00
|
|
|
with:
|
|
|
|
version: ${{ inputs.buildx-version || env.BUILDX_VERSION }}
|
|
|
|
driver-opts: |
|
|
|
|
image=${{ inputs.buildkit-image || env.BUILDKIT_IMAGE }}
|
|
|
|
network=host
|
|
|
|
env.http_proxy=http://127.0.0.1:3128
|
|
|
|
env.https_proxy=http://127.0.0.1:3128
|
|
|
|
buildkitd-flags: --debug
|
|
|
|
-
|
|
|
|
name: Build
|
|
|
|
uses: ./
|
|
|
|
with:
|
|
|
|
context: ./test
|
|
|
|
file: ./test/Dockerfile
|
2023-10-24 13:23:44 +08:00
|
|
|
|
|
|
|
annotations:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
env:
|
|
|
|
DOCKER_IMAGE: localhost:5000/name/app
|
|
|
|
services:
|
|
|
|
registry:
|
|
|
|
image: registry:2
|
|
|
|
ports:
|
|
|
|
- 5000:5000
|
|
|
|
steps:
|
|
|
|
-
|
|
|
|
name: Checkout
|
|
|
|
uses: actions/checkout@v4
|
|
|
|
-
|
|
|
|
name: Docker meta
|
|
|
|
id: meta
|
|
|
|
uses: docker/metadata-action@v5
|
|
|
|
with:
|
|
|
|
images: ${{ env.DOCKER_IMAGE }}
|
|
|
|
tags: |
|
|
|
|
type=schedule
|
|
|
|
type=ref,event=branch
|
|
|
|
type=ref,event=pr
|
|
|
|
type=semver,pattern={{version}}
|
|
|
|
type=semver,pattern={{major}}.{{minor}}
|
|
|
|
type=semver,pattern={{major}}
|
|
|
|
type=sha
|
|
|
|
-
|
|
|
|
name: Set up Docker Buildx
|
|
|
|
uses: docker/setup-buildx-action@v3
|
|
|
|
with:
|
|
|
|
version: ${{ inputs.buildx-version || env.BUILDX_VERSION }}
|
|
|
|
driver-opts: |
|
|
|
|
network=host
|
|
|
|
image=${{ inputs.buildkit-image || env.BUILDKIT_IMAGE }}
|
|
|
|
-
|
|
|
|
name: Build and push to local registry
|
|
|
|
uses: ./
|
|
|
|
with:
|
|
|
|
context: ./test
|
|
|
|
file: ./test/Dockerfile
|
|
|
|
push: true
|
|
|
|
tags: ${{ steps.meta.outputs.tags }}
|
|
|
|
annotations: |
|
|
|
|
index:com.example.key=value
|
|
|
|
index:com.example.key2=value2
|
|
|
|
manifest:com.example.key3=value3
|
|
|
|
-
|
|
|
|
name: Check manifest
|
|
|
|
run: |
|
|
|
|
docker buildx imagetools inspect ${{ env.DOCKER_IMAGE }}:${{ steps.meta.outputs.version }} --format '{{json .}}'
|
2024-03-08 21:00:50 +08:00
|
|
|
|
|
|
|
multi-output:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
services:
|
|
|
|
registry:
|
|
|
|
image: registry:2
|
|
|
|
ports:
|
|
|
|
- 5000:5000
|
|
|
|
steps:
|
|
|
|
-
|
|
|
|
name: Checkout
|
|
|
|
uses: actions/checkout@v4
|
|
|
|
-
|
|
|
|
name: Set up QEMU
|
|
|
|
uses: docker/setup-qemu-action@v3
|
|
|
|
-
|
|
|
|
name: Set up Docker Buildx
|
|
|
|
uses: docker/setup-buildx-action@v3
|
|
|
|
with:
|
|
|
|
version: ${{ inputs.buildx-version || env.BUILDX_VERSION }}
|
|
|
|
driver-opts: |
|
|
|
|
network=host
|
2024-04-15 15:47:50 +08:00
|
|
|
image=${{ inputs.buildkit-image || env.BUILDKIT_IMAGE }}
|
2024-03-08 21:00:50 +08:00
|
|
|
buildkitd-flags: --debug
|
|
|
|
-
|
|
|
|
name: Build
|
|
|
|
uses: ./
|
|
|
|
with:
|
|
|
|
context: ./test
|
|
|
|
file: ./test/Dockerfile
|
|
|
|
outputs: |
|
|
|
|
type=image,name=localhost:5000/name/app:latest,push=true
|
|
|
|
type=docker,name=app:local
|
|
|
|
type=oci,dest=/tmp/oci.tar
|
|
|
|
-
|
|
|
|
name: Check registry
|
|
|
|
run: |
|
|
|
|
docker buildx imagetools inspect localhost:5000/name/app:latest --format '{{json .}}'
|
|
|
|
-
|
|
|
|
name: Check docker
|
|
|
|
run: |
|
|
|
|
docker image inspect app:local
|
|
|
|
-
|
|
|
|
name: Check oci
|
|
|
|
run: |
|
|
|
|
set -ex
|
|
|
|
mkdir -p /tmp/oci-out
|
|
|
|
tar xf /tmp/oci.tar -C /tmp/oci-out
|
|
|
|
tree -nh /tmp/oci-out
|
|
|
|
|
|
|
|
load-and-push:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
services:
|
|
|
|
registry:
|
|
|
|
image: registry:2
|
|
|
|
ports:
|
|
|
|
- 5000:5000
|
|
|
|
steps:
|
|
|
|
-
|
|
|
|
name: Checkout
|
|
|
|
uses: actions/checkout@v4
|
|
|
|
-
|
|
|
|
name: Set up QEMU
|
|
|
|
uses: docker/setup-qemu-action@v3
|
|
|
|
-
|
|
|
|
name: Set up Docker Buildx
|
|
|
|
uses: docker/setup-buildx-action@v3
|
|
|
|
with:
|
|
|
|
version: ${{ inputs.buildx-version || env.BUILDX_VERSION }}
|
|
|
|
driver-opts: |
|
|
|
|
network=host
|
2024-04-15 15:47:50 +08:00
|
|
|
image=${{ inputs.buildkit-image || env.BUILDKIT_IMAGE }}
|
2024-03-08 21:00:50 +08:00
|
|
|
buildkitd-flags: --debug
|
|
|
|
-
|
|
|
|
name: Build
|
|
|
|
uses: ./
|
|
|
|
with:
|
|
|
|
context: ./test
|
|
|
|
file: ./test/Dockerfile
|
|
|
|
load: true
|
|
|
|
push: true
|
|
|
|
tags: localhost:5000/name/app:latest
|
|
|
|
-
|
|
|
|
name: Check registry
|
|
|
|
run: |
|
|
|
|
docker buildx imagetools inspect localhost:5000/name/app:latest --format '{{json .}}'
|
|
|
|
-
|
|
|
|
name: Check docker
|
|
|
|
run: |
|
|
|
|
docker image inspect localhost:5000/name/app:latest
|
2024-05-15 15:40:14 +08:00
|
|
|
|
2024-06-27 17:26:35 +08:00
|
|
|
summary-disable:
|
2024-05-15 15:40:14 +08:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
-
|
|
|
|
name: Checkout
|
|
|
|
uses: actions/checkout@v4
|
|
|
|
with:
|
|
|
|
path: action
|
|
|
|
-
|
|
|
|
name: Set up Docker Buildx
|
|
|
|
uses: docker/setup-buildx-action@v3
|
|
|
|
with:
|
|
|
|
version: ${{ inputs.buildx-version || env.BUILDX_VERSION }}
|
|
|
|
driver-opts: |
|
|
|
|
image=${{ inputs.buildkit-image || env.BUILDKIT_IMAGE }}
|
|
|
|
-
|
|
|
|
name: Build
|
|
|
|
uses: ./action
|
|
|
|
with:
|
|
|
|
file: ./test/Dockerfile
|
|
|
|
env:
|
2024-07-02 23:38:24 +08:00
|
|
|
DOCKER_BUILD_SUMMARY: false
|
|
|
|
|
|
|
|
summary-disable-deprecated:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
-
|
|
|
|
name: Checkout
|
|
|
|
uses: actions/checkout@v4
|
|
|
|
with:
|
|
|
|
path: action
|
|
|
|
-
|
|
|
|
name: Set up Docker Buildx
|
|
|
|
uses: docker/setup-buildx-action@v3
|
|
|
|
with:
|
|
|
|
version: ${{ inputs.buildx-version || env.BUILDX_VERSION }}
|
|
|
|
driver-opts: |
|
|
|
|
image=${{ inputs.buildkit-image || env.BUILDKIT_IMAGE }}
|
|
|
|
-
|
|
|
|
name: Build
|
|
|
|
uses: ./action
|
|
|
|
with:
|
|
|
|
file: ./test/Dockerfile
|
|
|
|
env:
|
|
|
|
DOCKER_BUILD_NO_SUMMARY: true
|
2024-06-24 16:14:14 +08:00
|
|
|
|
2024-06-27 17:26:35 +08:00
|
|
|
summary-not-supported:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
-
|
|
|
|
name: Checkout
|
|
|
|
uses: actions/checkout@v4
|
|
|
|
with:
|
|
|
|
path: action
|
|
|
|
-
|
|
|
|
name: Set up Docker Buildx
|
|
|
|
uses: docker/setup-buildx-action@v3
|
|
|
|
with:
|
|
|
|
version: v0.12.1
|
|
|
|
driver-opts: |
|
|
|
|
image=${{ inputs.buildkit-image || env.BUILDKIT_IMAGE }}
|
|
|
|
-
|
|
|
|
name: Build
|
|
|
|
uses: ./action
|
|
|
|
with:
|
|
|
|
file: ./test/Dockerfile
|
|
|
|
|
2024-07-03 00:07:54 +08:00
|
|
|
record-upload-disable:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
-
|
|
|
|
name: Checkout
|
|
|
|
uses: actions/checkout@v4
|
|
|
|
with:
|
|
|
|
path: action
|
|
|
|
-
|
|
|
|
name: Set up Docker Buildx
|
|
|
|
uses: docker/setup-buildx-action@v3
|
|
|
|
with:
|
|
|
|
version: ${{ inputs.buildx-version || env.BUILDX_VERSION }}
|
|
|
|
driver-opts: |
|
|
|
|
image=${{ inputs.buildkit-image || env.BUILDKIT_IMAGE }}
|
|
|
|
-
|
|
|
|
name: Build
|
|
|
|
uses: ./action
|
|
|
|
with:
|
|
|
|
file: ./test/Dockerfile
|
|
|
|
env:
|
|
|
|
DOCKER_BUILD_RECORD_UPLOAD: false
|
|
|
|
|
2024-07-03 00:09:36 +08:00
|
|
|
record-retention-days:
|
2024-06-24 16:14:14 +08:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
|
|
|
days:
|
|
|
|
- 2
|
|
|
|
- 0
|
|
|
|
steps:
|
|
|
|
-
|
|
|
|
name: Checkout
|
|
|
|
uses: actions/checkout@v4
|
|
|
|
with:
|
|
|
|
path: action
|
|
|
|
-
|
|
|
|
name: Set up Docker Buildx
|
|
|
|
uses: docker/setup-buildx-action@v3
|
|
|
|
with:
|
|
|
|
version: ${{ inputs.buildx-version || env.BUILDX_VERSION }}
|
|
|
|
driver-opts: |
|
|
|
|
image=${{ inputs.buildkit-image || env.BUILDKIT_IMAGE }}
|
|
|
|
-
|
|
|
|
name: Build
|
|
|
|
uses: ./action
|
|
|
|
with:
|
|
|
|
file: ./test/Dockerfile
|
|
|
|
env:
|
2024-07-03 00:09:36 +08:00
|
|
|
DOCKER_BUILD_RECORD_RETENTION_DAYS: ${{ matrix.days }}
|
2024-07-30 23:48:59 +08:00
|
|
|
|
|
|
|
checks:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
|
|
|
buildx-version:
|
|
|
|
- latest
|
|
|
|
- v0.14.1
|
|
|
|
steps:
|
|
|
|
-
|
|
|
|
name: Checkout
|
|
|
|
uses: actions/checkout@v4
|
|
|
|
-
|
|
|
|
name: Set up Docker Buildx
|
|
|
|
uses: docker/setup-buildx-action@v3
|
|
|
|
with:
|
|
|
|
version: ${{ matrix.buildx-version }}
|
|
|
|
driver-opts: |
|
|
|
|
image=${{ inputs.buildkit-image || env.BUILDKIT_IMAGE }}
|
|
|
|
-
|
|
|
|
name: Build
|
|
|
|
uses: ./
|
|
|
|
with:
|
|
|
|
context: ./test
|
|
|
|
file: ./test/lint.Dockerfile
|