refactor: remove legacy controller Docker build (#1360) [skip ci]

* refactor: remove legacy build and use buildkit

* refactor: add runner version to root makefie

* refactor: enable buildkit for runner make build

* refactor: ignore runner makefile in ci

Co-authored-by: toast-gear <toast-gear@users.noreply.github.com>
This commit is contained in:
Callum Tait 2022-04-27 08:21:02 +01:00 committed by GitHub
parent 9fdb2c009d
commit 059481b610
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 8 additions and 8 deletions

View File

@ -21,7 +21,8 @@
}, },
{ {
"fileMatch": [ "fileMatch": [
"runner/Makefile" "runner/Makefile",
"Makefile"
], ],
"matchStrings": ["RUNNER_VERSION \\?= +(?<currentValue>.*?)\\n"], "matchStrings": ["RUNNER_VERSION \\?= +(?<currentValue>.*?)\\n"],
"depNameTemplate": "actions/runner", "depNameTemplate": "actions/runner",

View File

@ -11,6 +11,7 @@ on:
- 'master' - 'master'
paths: paths:
- 'runner/**' - 'runner/**'
- '!runner/Makefile'
- .github/workflows/runners.yml - .github/workflows/runners.yml
- '!**.md' - '!**.md'

View File

@ -5,6 +5,7 @@ else
endif endif
DOCKER_USER ?= $(shell echo ${NAME} | cut -d / -f1) DOCKER_USER ?= $(shell echo ${NAME} | cut -d / -f1)
VERSION ?= latest VERSION ?= latest
RUNNER_VERSION ?= 2.290.1
TARGETPLATFORM ?= $(shell arch) TARGETPLATFORM ?= $(shell arch)
RUNNER_NAME ?= ${DOCKER_USER}/actions-runner RUNNER_NAME ?= ${DOCKER_USER}/actions-runner
RUNNER_TAG ?= ${VERSION} RUNNER_TAG ?= ${VERSION}
@ -109,13 +110,9 @@ vet:
generate: controller-gen generate: controller-gen
$(CONTROLLER_GEN) object:headerFile=./hack/boilerplate.go.txt paths="./..." $(CONTROLLER_GEN) object:headerFile=./hack/boilerplate.go.txt paths="./..."
# Build the docker image
docker-build:
docker build -t ${NAME}:${VERSION} .
docker build -t ${RUNNER_NAME}:${RUNNER_TAG} --build-arg TARGETPLATFORM=${TARGETPLATFORM} runner
docker-buildx: docker-buildx:
export DOCKER_CLI_EXPERIMENTAL=enabled export DOCKER_CLI_EXPERIMENTAL=enabled ;\
export DOCKER_BUILDKIT=1
@if ! docker buildx ls | grep -q container-builder; then\ @if ! docker buildx ls | grep -q container-builder; then\
docker buildx create --platform ${PLATFORMS} --name container-builder --use;\ docker buildx create --platform ${PLATFORMS} --name container-builder --use;\
fi fi

View File

@ -33,7 +33,8 @@ docker-push-ubuntu:
docker push ${DIND_RUNNER_NAME}:${TAG} docker push ${DIND_RUNNER_NAME}:${TAG}
docker-buildx-ubuntu: docker-buildx-ubuntu:
export DOCKER_CLI_EXPERIMENTAL=enabled export DOCKER_CLI_EXPERIMENTAL=enabled ;\
export DOCKER_BUILDKIT=1
@if ! docker buildx ls | grep -q container-builder; then\ @if ! docker buildx ls | grep -q container-builder; then\
docker buildx create --platform ${PLATFORMS} --name container-builder --use;\ docker buildx create --platform ${PLATFORMS} --name container-builder --use;\
fi fi