Skip to content

Commit 72ac948

Browse files
authored
NO-JIRA: default to building --platform=linux/amd64 images in Docker builds (#596)
This update sets the `--platform` flag in Docker build commands, allowing builds for specific architectures by using the `ARCH` variable. The default architecture is set to `linux/amd64`, ensuring compatibility and flexibility for multi-platform environments.
1 parent 4ec227f commit 72ac948

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

components/notebook-controller/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ run-culling: generate fmt vet manifests
9292
##@ Build
9393
.PHONY: docker-build
9494
docker-build: test ## Build docker image with the manager.
95-
cd .. && ${CONTAINER_ENGINE} build . -t ${IMG}:${TAG} -f ./notebook-controller/Dockerfile
95+
cd .. && ${CONTAINER_ENGINE} build . --platform="${ARCH}" -t ${IMG}:${TAG} -f ./notebook-controller/Dockerfile
9696

9797
.PHONY: docker-push
9898
docker-push: ## Push docker image with the manager.

components/odh-notebook-controller/Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ include makefile-vars.mk
44
# Image URL to use all building/pushing image targets
55
IMG ?= quay.io/opendatahub/odh-notebook-controller
66
TAG ?= $(shell git describe --tags --always)
7+
ARCH ?= linux/amd64
78

89
KF_IMG ?= quay.io/opendatahub/kubeflow-notebook-controller
910
KF_TAG ?= $(KF_TAG)
@@ -115,7 +116,7 @@ run: manifests generate fmt vet certificates ktunnel ## Run a controller from yo
115116

116117
.PHONY: docker-build
117118
docker-build: test ## Build docker image with the manager.
118-
cd ../ && ${CONTAINER_ENGINE} build . -t ${IMG}:${TAG} -f odh-notebook-controller/Dockerfile
119+
cd ../ && ${CONTAINER_ENGINE} build . --platform="${ARCH}" -t ${IMG}:${TAG} -f odh-notebook-controller/Dockerfile
119120

120121
.PHONY: docker-push
121122
docker-push: ## Push docker image with the manager.

0 commit comments

Comments
 (0)