2020-08-15 18:36:41 -04:00
|
|
|
name: ci
|
|
|
|
|
|
|
|
on:
|
2020-10-22 18:38:26 -04:00
|
|
|
workflow_dispatch:
|
2020-08-15 18:36:41 -04:00
|
|
|
push:
|
2020-09-12 14:53:25 -04:00
|
|
|
branches:
|
2022-01-18 08:57:27 -05:00
|
|
|
- 'master'
|
2020-08-15 18:36:41 -04:00
|
|
|
pull_request:
|
2020-09-12 14:53:25 -04:00
|
|
|
branches:
|
2022-01-18 08:57:27 -05:00
|
|
|
- 'master'
|
2020-08-15 18:36:41 -04:00
|
|
|
|
|
|
|
jobs:
|
2020-10-19 16:17:35 -04:00
|
|
|
minimal:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
-
|
|
|
|
name: Checkout
|
2020-11-17 04:06:56 -05:00
|
|
|
uses: actions/checkout@v2
|
2020-10-19 16:17:35 -04:00
|
|
|
with:
|
|
|
|
path: action
|
|
|
|
-
|
|
|
|
name: Set up Docker Buildx
|
|
|
|
uses: docker/setup-buildx-action@v1
|
|
|
|
-
|
|
|
|
name: Build
|
|
|
|
uses: ./action
|
|
|
|
with:
|
|
|
|
file: ./test/Dockerfile
|
|
|
|
-
|
|
|
|
name: Dump context
|
|
|
|
if: always()
|
|
|
|
uses: crazy-max/ghaction-dump-context@v1
|
|
|
|
|
2020-09-02 04:07:11 -04:00
|
|
|
git-context:
|
2020-08-17 16:18:15 -04:00
|
|
|
runs-on: ubuntu-latest
|
2020-09-22 14:53:40 -04:00
|
|
|
services:
|
|
|
|
registry:
|
|
|
|
image: registry:2
|
|
|
|
ports:
|
|
|
|
- 5000:5000
|
|
|
|
steps:
|
|
|
|
-
|
|
|
|
name: Checkout
|
2020-11-17 04:06:56 -05:00
|
|
|
uses: actions/checkout@v2
|
2020-10-03 16:44:16 -04:00
|
|
|
with:
|
|
|
|
path: action
|
2020-09-22 14:53:40 -04:00
|
|
|
-
|
|
|
|
name: Set up QEMU
|
|
|
|
uses: docker/setup-qemu-action@v1
|
|
|
|
-
|
|
|
|
name: Set up Docker Buildx
|
|
|
|
id: buildx
|
|
|
|
uses: docker/setup-buildx-action@v1
|
|
|
|
with:
|
|
|
|
version: latest
|
|
|
|
driver-opts: network=host
|
|
|
|
-
|
|
|
|
name: Build and push
|
|
|
|
id: docker_build
|
2020-10-03 16:44:16 -04:00
|
|
|
uses: ./action
|
2020-09-22 14:53:40 -04: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: |
|
|
|
|
docker buildx imagetools inspect localhost:5000/name/app:1.0.0
|
2020-10-21 03:51:06 -04: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-22 14:53:40 -04:00
|
|
|
-
|
|
|
|
name: Dump context
|
|
|
|
if: always()
|
|
|
|
uses: crazy-max/ghaction-dump-context@v1
|
|
|
|
|
|
|
|
git-context-secret:
|
|
|
|
runs-on: ubuntu-latest
|
2020-09-04 23:18:15 -04:00
|
|
|
services:
|
|
|
|
registry:
|
|
|
|
image: registry:2
|
|
|
|
ports:
|
|
|
|
- 5000:5000
|
2020-08-17 16:18:15 -04:00
|
|
|
steps:
|
|
|
|
-
|
|
|
|
name: Checkout
|
2020-11-17 04:06:56 -05:00
|
|
|
uses: actions/checkout@v2
|
2020-10-03 16:44:16 -04:00
|
|
|
with:
|
|
|
|
path: action
|
2020-08-17 16:18:15 -04:00
|
|
|
-
|
|
|
|
name: Set up QEMU
|
2020-09-08 18:32:40 -04:00
|
|
|
uses: docker/setup-qemu-action@v1
|
2020-08-17 16:18:15 -04:00
|
|
|
-
|
|
|
|
name: Set up Docker Buildx
|
|
|
|
id: buildx
|
2020-09-08 18:32:40 -04:00
|
|
|
uses: docker/setup-buildx-action@v1
|
2020-08-17 16:18:15 -04:00
|
|
|
with:
|
2020-09-03 12:17:27 -04:00
|
|
|
driver-opts: network=host
|
2020-08-17 16:18:15 -04:00
|
|
|
-
|
|
|
|
name: Build and push
|
|
|
|
id: docker_build
|
2020-10-03 16:44:16 -04:00
|
|
|
uses: ./action
|
2020-08-17 16:18:15 -04:00
|
|
|
with:
|
|
|
|
file: ./test/Dockerfile
|
|
|
|
builder: ${{ steps.buildx.outputs.name }}
|
2020-09-02 04:07:11 -04:00
|
|
|
platforms: linux/amd64,linux/arm64
|
2020-08-17 16:18:15 -04:00
|
|
|
push: true
|
|
|
|
tags: |
|
|
|
|
localhost:5000/name/app:latest
|
|
|
|
localhost:5000/name/app:1.0.0
|
2020-09-02 04:07:11 -04:00
|
|
|
secrets: |
|
2020-09-23 05:04:40 -04:00
|
|
|
GIT_AUTH_TOKEN=${{ github.token }}
|
2020-11-17 15:38:45 -05:00
|
|
|
"MYSECRET=aaaaaaaa
|
|
|
|
bbbbbbb
|
|
|
|
ccccccccc"
|
|
|
|
FOO=bar
|
|
|
|
"EMPTYLINE=aaaa
|
|
|
|
|
|
|
|
bbbb
|
|
|
|
ccc"
|
2020-08-17 16:18:15 -04:00
|
|
|
-
|
|
|
|
name: Inspect
|
|
|
|
run: |
|
|
|
|
docker buildx imagetools inspect localhost:5000/name/app:1.0.0
|
2020-10-21 03:51:06 -04: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-17 16:18:15 -04:00
|
|
|
-
|
|
|
|
name: Dump context
|
|
|
|
if: always()
|
|
|
|
uses: crazy-max/ghaction-dump-context@v1
|
|
|
|
|
2020-09-02 04:07:11 -04:00
|
|
|
path-context:
|
2020-08-15 18:36:41 -04:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
2020-08-22 21:31:38 -04:00
|
|
|
buildx-version:
|
|
|
|
- ""
|
|
|
|
- latest
|
2020-09-04 23:18:15 -04:00
|
|
|
services:
|
|
|
|
registry:
|
|
|
|
image: registry:2
|
|
|
|
ports:
|
|
|
|
- 5000:5000
|
2020-08-15 18:36:41 -04:00
|
|
|
steps:
|
|
|
|
-
|
|
|
|
name: Checkout
|
2020-11-17 04:06:56 -05:00
|
|
|
uses: actions/checkout@v2
|
2020-08-15 18:36:41 -04:00
|
|
|
-
|
|
|
|
name: Set up QEMU
|
2020-09-08 18:32:40 -04:00
|
|
|
uses: docker/setup-qemu-action@v1
|
2020-08-15 18:36:41 -04:00
|
|
|
-
|
|
|
|
name: Set up Docker Buildx
|
|
|
|
id: buildx
|
2020-09-08 18:32:40 -04:00
|
|
|
uses: docker/setup-buildx-action@v1
|
2020-08-16 20:33:38 -04:00
|
|
|
with:
|
2020-08-22 21:31:38 -04:00
|
|
|
version: ${{ matrix.buildx-version }}
|
2020-09-03 12:17:27 -04:00
|
|
|
driver-opts: network=host
|
2020-08-15 18:36:41 -04:00
|
|
|
-
|
|
|
|
name: Build and push
|
2020-08-22 22:07:29 -04:00
|
|
|
id: docker_build
|
2020-08-15 18:36:41 -04:00
|
|
|
uses: ./
|
|
|
|
with:
|
|
|
|
context: ./test
|
2020-09-02 04:07:11 -04:00
|
|
|
file: ./test/Dockerfile
|
2020-08-15 21:21:48 -04:00
|
|
|
builder: ${{ steps.buildx.outputs.name }}
|
2020-08-16 20:33:38 -04:00
|
|
|
push: true
|
2020-08-15 18:36:41 -04:00
|
|
|
tags: |
|
|
|
|
localhost:5000/name/app:latest
|
|
|
|
localhost:5000/name/app:1.0.0
|
2020-08-16 20:42:46 -04:00
|
|
|
-
|
|
|
|
name: Inspect
|
|
|
|
run: |
|
|
|
|
docker buildx imagetools inspect localhost:5000/name/app:1.0.0
|
2020-10-20 20:46:41 -04: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-15 18:36:41 -04:00
|
|
|
-
|
|
|
|
name: Dump context
|
2020-08-16 11:18:08 -04:00
|
|
|
if: always()
|
|
|
|
uses: crazy-max/ghaction-dump-context@v1
|
|
|
|
|
2020-10-21 15:07:52 -04:00
|
|
|
error:
|
2021-04-27 10:16:22 -04:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
-
|
|
|
|
name: Checkout
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
-
|
|
|
|
name: Stop docker
|
|
|
|
run: |
|
|
|
|
sudo systemctl stop docker
|
|
|
|
-
|
|
|
|
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
|
|
|
|
-
|
|
|
|
name: Dump context
|
|
|
|
if: always()
|
|
|
|
uses: crazy-max/ghaction-dump-context@v1
|
|
|
|
|
|
|
|
error-buildx:
|
2020-10-21 15:07:52 -04:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
-
|
|
|
|
name: Checkout
|
2020-11-17 04:06:56 -05:00
|
|
|
uses: actions/checkout@v2
|
2020-10-21 15:07:52 -04:00
|
|
|
-
|
|
|
|
name: Set up QEMU
|
|
|
|
uses: docker/setup-qemu-action@v1
|
|
|
|
-
|
|
|
|
name: Set up Docker Buildx
|
|
|
|
uses: docker/setup-buildx-action@v1
|
|
|
|
-
|
|
|
|
name: Build
|
2020-10-22 18:38:26 -04:00
|
|
|
id: docker_build
|
2020-10-21 15:07:52 -04: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-22 18:38:26 -04: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-21 15:07:52 -04:00
|
|
|
-
|
|
|
|
name: Dump context
|
|
|
|
if: always()
|
|
|
|
uses: crazy-max/ghaction-dump-context@v1
|
|
|
|
|
|
|
|
docker-driver:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
services:
|
|
|
|
registry:
|
|
|
|
image: registry:2
|
|
|
|
ports:
|
|
|
|
- 5000:5000
|
|
|
|
steps:
|
|
|
|
-
|
|
|
|
name: Checkout
|
2020-11-17 04:06:56 -05:00
|
|
|
uses: actions/checkout@v2
|
2020-10-21 15:07:52 -04:00
|
|
|
-
|
|
|
|
name: Build
|
2020-10-22 18:38:26 -04:00
|
|
|
id: docker_build
|
2020-10-21 15:07:52 -04:00
|
|
|
uses: ./
|
|
|
|
with:
|
|
|
|
context: ./test
|
|
|
|
file: ./test/Dockerfile
|
2021-01-15 13:21:19 -05:00
|
|
|
push: true
|
2020-10-21 15:07:52 -04:00
|
|
|
tags: localhost:5000/name/app:latest
|
|
|
|
-
|
|
|
|
name: Dump context
|
|
|
|
if: always()
|
|
|
|
uses: crazy-max/ghaction-dump-context@v1
|
|
|
|
|
2020-10-22 15:50:22 -04:00
|
|
|
export-docker:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
-
|
|
|
|
name: Checkout
|
2020-11-17 04:06:56 -05:00
|
|
|
uses: actions/checkout@v2
|
2020-10-22 15:50:22 -04:00
|
|
|
-
|
|
|
|
name: Build
|
|
|
|
uses: ./
|
|
|
|
with:
|
|
|
|
context: ./test
|
|
|
|
file: ./test/Dockerfile
|
|
|
|
load: true
|
|
|
|
tags: myimage:latest
|
|
|
|
-
|
|
|
|
name: Inspect
|
|
|
|
run: |
|
|
|
|
docker image inspect myimage:latest
|
|
|
|
-
|
|
|
|
name: Dump context
|
|
|
|
if: always()
|
|
|
|
uses: crazy-max/ghaction-dump-context@v1
|
|
|
|
|
2021-04-06 08:49:15 -04:00
|
|
|
network:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
-
|
|
|
|
name: Checkout
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
-
|
|
|
|
name: Set up Docker Buildx
|
|
|
|
uses: docker/setup-buildx-action@v1
|
|
|
|
-
|
|
|
|
name: List networks
|
|
|
|
run: docker network ls
|
|
|
|
-
|
|
|
|
name: Build
|
|
|
|
uses: ./
|
|
|
|
with:
|
|
|
|
context: ./test
|
|
|
|
tags: name/app:latest
|
|
|
|
network: host
|
|
|
|
-
|
|
|
|
name: Dump context
|
|
|
|
if: always()
|
|
|
|
uses: crazy-max/ghaction-dump-context@v1
|
|
|
|
|
2021-11-16 01:19:27 -05:00
|
|
|
shm-size:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
-
|
|
|
|
name: Checkout
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
-
|
|
|
|
name: Set up Docker Buildx
|
|
|
|
uses: docker/setup-buildx-action@v1
|
|
|
|
with:
|
|
|
|
version: v0.7.0
|
|
|
|
driver-opts: |
|
|
|
|
image=moby/buildkit:master
|
|
|
|
-
|
|
|
|
name: Build
|
|
|
|
uses: ./
|
|
|
|
with:
|
|
|
|
context: ./test
|
|
|
|
file: ./test/shmsize.Dockerfile
|
|
|
|
tags: name/app:latest
|
|
|
|
shm-size: 2g
|
|
|
|
-
|
|
|
|
name: Dump context
|
|
|
|
if: always()
|
|
|
|
uses: crazy-max/ghaction-dump-context@v1
|
|
|
|
|
|
|
|
ulimit:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
-
|
|
|
|
name: Checkout
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
-
|
|
|
|
name: Set up Docker Buildx
|
|
|
|
uses: docker/setup-buildx-action@v1
|
|
|
|
with:
|
|
|
|
version: v0.7.0
|
|
|
|
driver-opts: |
|
|
|
|
image=moby/buildkit:master
|
|
|
|
-
|
|
|
|
name: Build
|
|
|
|
uses: ./
|
|
|
|
with:
|
|
|
|
context: ./test
|
|
|
|
file: ./test/ulimit.Dockerfile
|
|
|
|
tags: name/app:latest
|
|
|
|
ulimit: |
|
|
|
|
nofile=1024:1024
|
|
|
|
nproc=3
|
|
|
|
-
|
|
|
|
name: Dump context
|
|
|
|
if: always()
|
|
|
|
uses: crazy-max/ghaction-dump-context@v1
|
|
|
|
|
|
|
|
cgroup-parent:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
-
|
|
|
|
name: Checkout
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
-
|
|
|
|
name: Set up Docker Buildx
|
|
|
|
uses: docker/setup-buildx-action@v1
|
|
|
|
with:
|
|
|
|
version: v0.7.0
|
|
|
|
driver-opts: |
|
|
|
|
image=moby/buildkit:master
|
|
|
|
-
|
|
|
|
name: Build
|
|
|
|
uses: ./
|
|
|
|
with:
|
|
|
|
context: ./test
|
|
|
|
file: ./test/cgroup.Dockerfile
|
|
|
|
tags: name/app:latest
|
|
|
|
cgroup-parent: foo
|
|
|
|
-
|
|
|
|
name: Dump context
|
|
|
|
if: always()
|
|
|
|
uses: crazy-max/ghaction-dump-context@v1
|
|
|
|
|
2020-09-02 04:07:11 -04:00
|
|
|
multi:
|
2020-08-29 10:10:05 -04:00
|
|
|
runs-on: ubuntu-latest
|
2020-09-02 04:07:11 -04:00
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
|
|
|
buildx-version:
|
|
|
|
- ""
|
|
|
|
- latest
|
|
|
|
dockerfile:
|
|
|
|
- multi
|
|
|
|
- multi-sudo
|
2020-09-04 23:18:15 -04:00
|
|
|
services:
|
|
|
|
registry:
|
|
|
|
image: registry:2
|
|
|
|
ports:
|
|
|
|
- 5000:5000
|
2020-08-29 10:10:05 -04:00
|
|
|
steps:
|
|
|
|
-
|
|
|
|
name: Checkout
|
2020-11-17 04:06:56 -05:00
|
|
|
uses: actions/checkout@v2
|
2020-08-29 10:10:05 -04:00
|
|
|
-
|
|
|
|
name: Set up QEMU
|
2020-09-08 18:32:40 -04:00
|
|
|
uses: docker/setup-qemu-action@v1
|
2020-08-29 10:10:05 -04:00
|
|
|
-
|
|
|
|
name: Set up Docker Buildx
|
|
|
|
id: buildx
|
2020-09-08 18:32:40 -04:00
|
|
|
uses: docker/setup-buildx-action@v1
|
2020-08-29 10:10:05 -04:00
|
|
|
with:
|
2020-09-02 04:07:11 -04:00
|
|
|
version: ${{ matrix.buildx-version }}
|
2020-09-03 12:17:27 -04:00
|
|
|
driver-opts: network=host
|
2020-08-29 10:10:05 -04:00
|
|
|
-
|
|
|
|
name: Build and push
|
|
|
|
id: docker_build
|
|
|
|
uses: ./
|
|
|
|
with:
|
|
|
|
context: ./test
|
2021-03-28 10:43:51 -04:00
|
|
|
file: ./test/${{ matrix.dockerfile }}.Dockerfile
|
2020-08-29 10:10:05 -04: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: |
|
|
|
|
docker buildx imagetools inspect localhost:5000/name/app:1.0.0
|
2020-10-21 03:51:06 -04: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-29 10:10:05 -04:00
|
|
|
-
|
|
|
|
name: Dump context
|
|
|
|
if: always()
|
|
|
|
uses: crazy-max/ghaction-dump-context@v1
|
|
|
|
|
2020-10-03 18:01:14 -04:00
|
|
|
registry-cache:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
services:
|
|
|
|
registry:
|
|
|
|
image: registry:2
|
|
|
|
ports:
|
|
|
|
- 5000:5000
|
|
|
|
steps:
|
|
|
|
-
|
|
|
|
name: Checkout
|
2020-11-17 04:06:56 -05:00
|
|
|
uses: actions/checkout@v2
|
2020-10-03 18:01:14 -04:00
|
|
|
-
|
|
|
|
name: Set up QEMU
|
|
|
|
uses: docker/setup-qemu-action@v1
|
|
|
|
-
|
|
|
|
name: Set up Docker Buildx
|
|
|
|
id: buildx
|
|
|
|
uses: docker/setup-buildx-action@v1
|
|
|
|
with:
|
2020-10-11 13:17:08 -04:00
|
|
|
driver-opts: |
|
|
|
|
network=host
|
2020-10-03 18:01:14 -04:00
|
|
|
-
|
|
|
|
name: Build and push (1)
|
|
|
|
id: docker_build
|
|
|
|
uses: ./
|
|
|
|
with:
|
|
|
|
context: ./test
|
2021-03-28 10:43:51 -04:00
|
|
|
file: ./test/multi.Dockerfile
|
2020-10-03 18:01:14 -04: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-03 19:10:42 -04:00
|
|
|
cache-from: type=registry,ref=localhost:5000/name/app
|
|
|
|
cache-to: type=inline
|
2020-10-03 18:01:14 -04:00
|
|
|
-
|
|
|
|
name: Inspect (1)
|
|
|
|
run: |
|
2020-10-03 19:10:42 -04:00
|
|
|
docker buildx imagetools inspect localhost:5000/name/app:latest
|
2020-10-21 03:51:06 -04:00
|
|
|
-
|
|
|
|
name: Check digest (1)
|
|
|
|
run: |
|
|
|
|
if [ -z "${{ steps.docker_build.outputs.digest }}" ]; then
|
|
|
|
echo "::error::Digest should not be empty"
|
|
|
|
exit 1
|
|
|
|
fi
|
2020-10-03 18:01:14 -04:00
|
|
|
-
|
|
|
|
name: Prune
|
|
|
|
run: |
|
|
|
|
docker buildx prune -a -f --verbose
|
|
|
|
-
|
|
|
|
name: Build and push (2)
|
|
|
|
id: docker_build2
|
|
|
|
uses: ./
|
|
|
|
with:
|
|
|
|
context: ./test
|
2021-03-28 10:43:51 -04:00
|
|
|
file: ./test/multi.Dockerfile
|
2020-10-03 18:01:14 -04: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-03 19:10:42 -04:00
|
|
|
cache-from: type=registry,ref=localhost:5000/name/app
|
|
|
|
cache-to: type=inline
|
2020-10-03 18:01:14 -04:00
|
|
|
-
|
|
|
|
name: Inspect (2)
|
|
|
|
run: |
|
2020-10-03 19:10:42 -04:00
|
|
|
docker buildx imagetools inspect localhost:5000/name/app:latest
|
2020-10-03 18:01:14 -04:00
|
|
|
-
|
2020-10-21 03:51:06 -04:00
|
|
|
name: Check digest (2)
|
|
|
|
run: |
|
|
|
|
if [ -z "${{ steps.docker_build2.outputs.digest }}" ]; then
|
|
|
|
echo "::error::Digest should not be empty"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
-
|
|
|
|
name: Compare digests
|
2020-10-03 18:01:14 -04:00
|
|
|
run: |
|
|
|
|
echo Compare "${{ steps.docker_build.outputs.digest }}" with "${{ steps.docker_build2.outputs.digest }}"
|
|
|
|
if [ "${{ steps.docker_build.outputs.digest }}" != "${{ steps.docker_build2.outputs.digest }}" ]; then
|
|
|
|
echo "::error::Digests should be identical"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
-
|
|
|
|
name: Dump context
|
|
|
|
if: always()
|
|
|
|
uses: crazy-max/ghaction-dump-context@v1
|
|
|
|
|
2021-07-29 10:57:22 -04:00
|
|
|
local-cache-first:
|
2020-10-03 16:44:16 -04:00
|
|
|
runs-on: ubuntu-latest
|
2020-10-03 17:33:32 -04:00
|
|
|
outputs:
|
|
|
|
digest: ${{ steps.docker_build.outputs.digest }}
|
2020-10-03 16:44:16 -04:00
|
|
|
services:
|
|
|
|
registry:
|
|
|
|
image: registry:2
|
|
|
|
ports:
|
|
|
|
- 5000:5000
|
|
|
|
steps:
|
|
|
|
-
|
|
|
|
name: Checkout
|
2020-11-17 04:06:56 -05:00
|
|
|
uses: actions/checkout@v2
|
2020-10-03 16:44:16 -04:00
|
|
|
-
|
|
|
|
name: Set up QEMU
|
|
|
|
uses: docker/setup-qemu-action@v1
|
|
|
|
-
|
|
|
|
name: Set up Docker Buildx
|
|
|
|
id: buildx
|
|
|
|
uses: docker/setup-buildx-action@v1
|
|
|
|
with:
|
2020-10-11 13:17:08 -04:00
|
|
|
driver-opts: |
|
|
|
|
network=host
|
2020-10-03 16:44:16 -04:00
|
|
|
-
|
|
|
|
name: Cache Docker layers
|
|
|
|
uses: actions/cache@v2
|
|
|
|
with:
|
|
|
|
path: /tmp/.buildx-cache
|
2021-07-29 10:57:22 -04:00
|
|
|
key: ${{ runner.os }}-buildx-local-${{ github.sha }}
|
2020-10-03 16:44:16 -04:00
|
|
|
restore-keys: |
|
|
|
|
${{ runner.os }}-buildx-ghcache-
|
|
|
|
-
|
|
|
|
name: Erase cache
|
|
|
|
run: |
|
|
|
|
rm -rf /tmp/.buildx-cache/*
|
|
|
|
-
|
|
|
|
name: Build and push
|
|
|
|
id: docker_build
|
|
|
|
uses: ./
|
|
|
|
with:
|
|
|
|
context: ./test
|
2021-03-28 10:43:51 -04:00
|
|
|
file: ./test/multi.Dockerfile
|
2020-10-03 16:44:16 -04: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
|
|
|
|
cache-from: type=local,src=/tmp/.buildx-cache
|
|
|
|
cache-to: type=local,dest=/tmp/.buildx-cache
|
|
|
|
-
|
|
|
|
name: Inspect
|
|
|
|
run: |
|
|
|
|
docker buildx imagetools inspect localhost:5000/name/app:1.0.0
|
2020-10-21 03:51:06 -04:00
|
|
|
-
|
|
|
|
name: Check digest
|
|
|
|
run: |
|
|
|
|
if [ -z "${{ steps.docker_build.outputs.digest }}" ]; then
|
|
|
|
echo "::error::Digest should not be empty"
|
|
|
|
exit 1
|
|
|
|
fi
|
2020-10-03 16:44:16 -04:00
|
|
|
-
|
|
|
|
name: Dump context
|
|
|
|
if: always()
|
|
|
|
uses: crazy-max/ghaction-dump-context@v1
|
|
|
|
|
2021-07-29 10:57:22 -04:00
|
|
|
local-cache-hit:
|
2020-08-16 11:55:47 -04:00
|
|
|
runs-on: ubuntu-latest
|
2021-07-29 10:57:22 -04:00
|
|
|
needs: local-cache-first
|
2020-09-04 23:18:15 -04:00
|
|
|
services:
|
|
|
|
registry:
|
|
|
|
image: registry:2
|
|
|
|
ports:
|
|
|
|
- 5000:5000
|
2020-08-16 11:55:47 -04:00
|
|
|
steps:
|
|
|
|
-
|
|
|
|
name: Checkout
|
2020-11-17 04:06:56 -05:00
|
|
|
uses: actions/checkout@v2
|
2020-08-16 11:55:47 -04:00
|
|
|
-
|
|
|
|
name: Set up QEMU
|
2020-09-08 18:32:40 -04:00
|
|
|
uses: docker/setup-qemu-action@v1
|
2020-08-16 11:55:47 -04:00
|
|
|
-
|
|
|
|
name: Set up Docker Buildx
|
|
|
|
id: buildx
|
2020-09-08 18:32:40 -04:00
|
|
|
uses: docker/setup-buildx-action@v1
|
2020-08-16 13:22:14 -04:00
|
|
|
with:
|
2020-10-11 13:17:08 -04:00
|
|
|
driver-opts: |
|
|
|
|
network=host
|
2020-09-02 04:07:11 -04:00
|
|
|
-
|
|
|
|
name: Cache Docker layers
|
|
|
|
uses: actions/cache@v2
|
|
|
|
id: cache
|
|
|
|
with:
|
|
|
|
path: /tmp/.buildx-cache
|
2021-07-29 10:57:22 -04:00
|
|
|
key: ${{ runner.os }}-buildx-local-${{ github.sha }}
|
2020-09-02 04:07:11 -04:00
|
|
|
restore-keys: |
|
2020-10-03 16:44:16 -04:00
|
|
|
${{ runner.os }}-buildx-ghcache-
|
2020-08-16 11:55:47 -04:00
|
|
|
-
|
|
|
|
name: Build and push
|
2020-08-22 22:07:29 -04:00
|
|
|
id: docker_build
|
2020-08-16 11:55:47 -04:00
|
|
|
uses: ./
|
|
|
|
with:
|
2020-09-02 04:07:11 -04:00
|
|
|
context: ./test
|
2021-03-28 10:43:51 -04:00
|
|
|
file: ./test/multi.Dockerfile
|
2020-08-16 11:55:47 -04:00
|
|
|
builder: ${{ steps.buildx.outputs.name }}
|
2020-08-16 16:38:03 -04:00
|
|
|
platforms: linux/amd64,linux/arm64
|
2020-08-16 20:33:38 -04:00
|
|
|
push: true
|
2020-08-16 11:55:47 -04:00
|
|
|
tags: |
|
|
|
|
localhost:5000/name/app:latest
|
|
|
|
localhost:5000/name/app:1.0.0
|
2020-09-02 04:07:11 -04:00
|
|
|
cache-from: type=local,src=/tmp/.buildx-cache
|
|
|
|
cache-to: type=local,dest=/tmp/.buildx-cache
|
2020-08-16 20:42:46 -04:00
|
|
|
-
|
|
|
|
name: Inspect
|
|
|
|
run: |
|
|
|
|
docker buildx imagetools inspect localhost:5000/name/app:1.0.0
|
2020-10-03 17:33:32 -04:00
|
|
|
-
|
2020-10-21 03:51:06 -04:00
|
|
|
name: Check digest
|
|
|
|
run: |
|
|
|
|
if [ -z "${{ steps.docker_build.outputs.digest }}" ]; then
|
|
|
|
echo "::error::Digest should not be empty"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
-
|
|
|
|
name: Compare digests
|
2020-10-03 17:33:32 -04:00
|
|
|
run: |
|
2021-07-29 10:57:22 -04:00
|
|
|
echo Compare "${{ needs.local-cache-first.outputs.digest }}" with "${{ steps.docker_build.outputs.digest }}"
|
|
|
|
if [ "${{ needs.local-cache-first.outputs.digest }}" != "${{ steps.docker_build.outputs.digest }}" ]; then
|
2020-10-03 17:33:32 -04:00
|
|
|
echo "::error::Digests should be identical"
|
|
|
|
exit 1
|
|
|
|
fi
|
2020-09-02 04:07:11 -04:00
|
|
|
-
|
|
|
|
name: Cache hit
|
|
|
|
run: echo ${{ steps.cache.outputs.cache-hit }}
|
2020-08-16 11:55:47 -04:00
|
|
|
-
|
|
|
|
name: Dump context
|
|
|
|
if: always()
|
|
|
|
uses: crazy-max/ghaction-dump-context@v1
|
2021-07-29 10:57:22 -04:00
|
|
|
|
|
|
|
github-cache:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
|
|
|
buildx_version:
|
|
|
|
- ""
|
|
|
|
- latest
|
|
|
|
services:
|
|
|
|
registry:
|
|
|
|
image: registry:2
|
|
|
|
ports:
|
|
|
|
- 5000:5000
|
|
|
|
steps:
|
|
|
|
-
|
|
|
|
name: Checkout
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
-
|
|
|
|
name: Set up QEMU
|
|
|
|
uses: docker/setup-qemu-action@v1
|
|
|
|
-
|
|
|
|
name: Set up Docker Buildx
|
|
|
|
uses: docker/setup-buildx-action@v1
|
|
|
|
with:
|
|
|
|
version: ${{ matrix.buildx_version }}
|
|
|
|
driver-opts: |
|
|
|
|
network=host
|
|
|
|
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: |
|
|
|
|
docker buildx imagetools inspect localhost:5000/name/app:1.0.0
|
|
|
|
-
|
|
|
|
name: Dump context
|
|
|
|
if: always()
|
|
|
|
uses: crazy-max/ghaction-dump-context@v1
|