Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhance the docker-build make target to build for multiple platforms. #873

Merged
merged 1 commit into from
Sep 11, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,18 @@ REPO_ROOT := $(shell dirname "$(realpath $(lastword $(MAKEFILE_LIST)))
HACK_DIR := $(REPO_ROOT)/hack
VERSION := $(shell $(HACK_DIR)/get-version.sh)
GIT_SHA := $(shell git rev-parse --short HEAD || echo "GitNotFound")
REGISTRY_ROOT := europe-docker.pkg.dev/gardener-project
REGISTRY_ROOT := europe-docker.pkg.dev/gardener-project
REGISTRY := $(REGISTRY_ROOT)/snapshots
IMAGE_NAME := gardener/etcd-druid
IMAGE_REPOSITORY := $(REGISTRY)/$(IMAGE_NAME)
IMAGE_BUILD_TAG := $(VERSION)
PLATFORM ?= $(shell docker info --format '{{.OSType}}/{{.Architecture}}')
BUILD_DIR := build
PROVIDERS := ""
BUCKET_NAME := "e2e-test"
KUBECONFIG_PATH := $(HACK_DIR)/e2e-test/infrastructure/kind/kubeconfig
TEST_COVER := "true"
IMG ?= ${IMAGE_REPOSITORY}:${IMAGE_BUILD_TAG}
TEST_COVER := "true"
IMG ?= ${IMAGE_REPOSITORY}:${IMAGE_BUILD_TAG}

# Tools
# -------------------------------------------------------------------------
Expand Down Expand Up @@ -144,7 +145,7 @@ clean-build-cache:
# Build the docker image
.PHONY: docker-build
docker-build:
docker build . -t ${IMG} --rm
docker buildx build --platform=$(PLATFORM) --tag $(IMG) --rm .
@echo "updating kustomize image patch file for manager resource"
sed -i'' -e 's@image: .*@image: '"${IMG}"'@' ./config/default/manager_image_patch.yaml

Expand Down