From ab4eaaa5152beb8ab2cc8bbf79dbb0c36529cf5e Mon Sep 17 00:00:00 2001 From: Dominik Rosiek <58699848+sumo-drosiek@users.noreply.github.com> Date: Mon, 27 May 2024 12:17:36 +0200 Subject: [PATCH] fix: build ubi image only for specific platforms (#105) * feat: build ubi image only for specific platforms Signed-off-by: Dominik Rosiek * feat: fix dev builds Signed-off-by: Dominik Rosiek --------- Signed-off-by: Dominik Rosiek --- .github/workflows/dev_builds.yml | 9 ++++++--- .github/workflows/release_builds.yml | 6 ++++-- Dockerfile-ubi | 1 + Makefile | 3 ++- 4 files changed, 13 insertions(+), 6 deletions(-) diff --git a/.github/workflows/dev_builds.yml b/.github/workflows/dev_builds.yml index 56acfcb..ea848cb 100644 --- a/.github/workflows/dev_builds.yml +++ b/.github/workflows/dev_builds.yml @@ -4,6 +4,7 @@ on: push: branches: - main + - "dev-build/*" jobs: setup-image: @@ -39,7 +40,8 @@ jobs: - name: Build and push UBI image to Open Source ECR run: make build-push-multiplatform \ DOCKERFILE=Dockerfile-ubi \ - TAG_SUFFIX=-ubi + TAG_SUFFIX=-ubi \ + PLATFORMS=linux/amd64,linux/arm64 - name: Build and push image to Docker Hub run: |- @@ -50,5 +52,6 @@ jobs: run: |- make build-push-multiplatform \ REPO_URL=sumologic/kubernetes-setup \ - DOCKERFILE=Dockerfile-ubi - TAG_SUFFIX=-ubi + DOCKERFILE=Dockerfile-ubi \ + TAG_SUFFIX=-ubi \ + PLATFORMS=linux/amd64,linux/arm64 diff --git a/.github/workflows/release_builds.yml b/.github/workflows/release_builds.yml index db78a6b..90472e2 100644 --- a/.github/workflows/release_builds.yml +++ b/.github/workflows/release_builds.yml @@ -50,7 +50,8 @@ jobs: run: make build-push-multiplatform \ BUILD_TAG=${{ steps.extract_tag.outputs.tag }} \ TAG_SUFFIX=-ubi \ - DOCKERFILE=Dockerfile-ubi + DOCKERFILE=Dockerfile-ubi \ + PLATFORMS=linux/amd64,linux/arm64 - name: Build and push image to Docker Hub run: |- @@ -64,4 +65,5 @@ jobs: BUILD_TAG=${{ steps.extract_tag.outputs.tag }} \ REPO_URL=sumologic/kubernetes-setup \ TAG_SUFFIX=-ubi \ - DOCKERFILE=Dockerfile-ubi + DOCKERFILE=Dockerfile-ubi \ + PLATFORMS=linux/amd64,linux/arm64 diff --git a/Dockerfile-ubi b/Dockerfile-ubi index 69124a9..35a9d53 100644 --- a/Dockerfile-ubi +++ b/Dockerfile-ubi @@ -46,6 +46,7 @@ LABEL name="Sumo Logic Kubernetes Setup" \ release="1" \ summary="$SUMMARY" \ description="$DESCRIPTION" \ + io.k8s.description="$DESCRIPTION" \ maintainer="opensource-collection-team@sumologic.com" ADD LICENSE \ diff --git a/Makefile b/Makefile index 39de698..1beecc7 100644 --- a/Makefile +++ b/Makefile @@ -4,6 +4,7 @@ ECR_URL = public.ecr.aws/sumologic REPO_URL = $(ECR_URL)/$(IMAGE_NAME) DOCKERFILE = Dockerfile TAG_SUFFIX = "" +PLATFORMS = linux/amd64,linux/arm/v7,linux/arm64 build: DOCKER_BUILDKIT=1 docker build \ @@ -26,7 +27,7 @@ build-push-multiplatform: docker buildx build \ -f $(DOCKERFILE) \ --push \ - --platform linux/amd64,linux/arm/v7,linux/arm64 \ + --platform $(PLATFORMS) \ --build-arg BUILD_TAG=$(BUILD_TAG)$(TAG_SUFFIX) \ --tag $(REPO_URL):$(BUILD_TAG)$(TAG_SUFFIX) \ .