From 059481b6103fe4ccefd8fce638a7565f9feaa12d Mon Sep 17 00:00:00 2001 From: Callum Tait <15716903+toast-gear@users.noreply.github.com> Date: Wed, 27 Apr 2022 08:21:02 +0100 Subject: [PATCH] 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 --- .github/renovate.json5 | 3 ++- .github/workflows/runners.yml | 1 + Makefile | 9 +++------ runner/Makefile | 3 ++- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/renovate.json5 b/.github/renovate.json5 index e584a4ba..5e2705b5 100644 --- a/.github/renovate.json5 +++ b/.github/renovate.json5 @@ -21,7 +21,8 @@ }, { "fileMatch": [ - "runner/Makefile" + "runner/Makefile", + "Makefile" ], "matchStrings": ["RUNNER_VERSION \\?= +(?.*?)\\n"], "depNameTemplate": "actions/runner", diff --git a/.github/workflows/runners.yml b/.github/workflows/runners.yml index 73637bd1..8539b4fd 100644 --- a/.github/workflows/runners.yml +++ b/.github/workflows/runners.yml @@ -11,6 +11,7 @@ on: - 'master' paths: - 'runner/**' + - '!runner/Makefile' - .github/workflows/runners.yml - '!**.md' diff --git a/Makefile b/Makefile index 65f0fd29..1cd82af4 100644 --- a/Makefile +++ b/Makefile @@ -5,6 +5,7 @@ else endif DOCKER_USER ?= $(shell echo ${NAME} | cut -d / -f1) VERSION ?= latest +RUNNER_VERSION ?= 2.290.1 TARGETPLATFORM ?= $(shell arch) RUNNER_NAME ?= ${DOCKER_USER}/actions-runner RUNNER_TAG ?= ${VERSION} @@ -109,13 +110,9 @@ vet: generate: controller-gen $(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: - export DOCKER_CLI_EXPERIMENTAL=enabled + export DOCKER_CLI_EXPERIMENTAL=enabled ;\ + export DOCKER_BUILDKIT=1 @if ! docker buildx ls | grep -q container-builder; then\ docker buildx create --platform ${PLATFORMS} --name container-builder --use;\ fi diff --git a/runner/Makefile b/runner/Makefile index 1d9c039f..08e05172 100644 --- a/runner/Makefile +++ b/runner/Makefile @@ -33,7 +33,8 @@ docker-push-ubuntu: docker push ${DIND_RUNNER_NAME}:${TAG} 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\ docker buildx create --platform ${PLATFORMS} --name container-builder --use;\ fi