Skip to content

Commit

Permalink
fix: build ubi image only for specific platforms (#105)
Browse files Browse the repository at this point in the history
* feat: build ubi image only for specific platforms

Signed-off-by: Dominik Rosiek <[email protected]>

* feat: fix dev builds

Signed-off-by: Dominik Rosiek <[email protected]>

---------

Signed-off-by: Dominik Rosiek <[email protected]>
  • Loading branch information
sumo-drosiek authored May 27, 2024
1 parent 3253d3b commit ab4eaaa
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 6 deletions.
9 changes: 6 additions & 3 deletions .github/workflows/dev_builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
push:
branches:
- main
- "dev-build/*"

jobs:
setup-image:
Expand Down Expand Up @@ -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: |-
Expand All @@ -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
6 changes: 4 additions & 2 deletions .github/workflows/release_builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |-
Expand All @@ -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
1 change: 1 addition & 0 deletions Dockerfile-ubi
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ LABEL name="Sumo Logic Kubernetes Setup" \
release="1" \
summary="$SUMMARY" \
description="$DESCRIPTION" \
io.k8s.description="$DESCRIPTION" \
maintainer="[email protected]"

ADD LICENSE \
Expand Down
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand All @@ -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) \
.
Expand Down

0 comments on commit ab4eaaa

Please sign in to comment.