@@ -76,16 +76,28 @@ ${BIN_DIR}/deepcopy-gen:
76
76
$(info Compiling deepcopy-gen...)
77
77
go build -o ${BIN_DIR} /deepcopy-gen ./cmd/deepcopy-gen/
78
78
79
+
80
+ # Build the docker image and tag it.
79
81
images : verify-tag-name generate-code update-deployment-crds
80
82
$(info List executable directory)
81
83
$(info repo id: ${git_repository_id})
82
84
$(info branch: ${GIT_BRANCH})
83
85
$(info Build the docker image)
84
- ifeq ($(strip $(GO_BUILD_ARGS ) ) ,)
85
- docker build --quiet --no-cache --tag mcad-controller:${TAG} -f ${CURRENT_DIR}/Dockerfile ${CURRENT_DIR}
86
- else
87
- docker build --no-cache --tag mcad-controller:${TAG} --build-arg GO_BUILD_ARGS=$(GO_BUILD_ARGS) -f ${CURRENT_DIR}/Dockerfile ${CURRENT_DIR}
88
- endif
86
+ echo " Host architecture: $( shell uname -m) "
87
+ @HOST_ARCH=$(shell uname -m) ; \
88
+ if [ " $$ HOST_ARCH" = " arm64" ]; then \
89
+ if [ " $( strip $( GO_BUILD_ARGS) ) " = " " ]; then \
90
+ docker buildx build --platform linux/amd64 --no-cache --tag mcad-controller:${TAG} -f ${CURRENT_DIR} /Dockerfile ${CURRENT_DIR} ; \
91
+ else \
92
+ docker buildx build --platform linux/amd64 --no-cache --tag mcad-controller:${TAG} --build-arg GO_BUILD_ARGS=$(GO_BUILD_ARGS ) -f ${CURRENT_DIR} /Dockerfile ${CURRENT_DIR} ; \
93
+ fi \
94
+ else \
95
+ if [ " $( strip $( GO_BUILD_ARGS) ) " = " " ]; then \
96
+ docker build --no-cache --tag mcad-controller:${TAG} -f ${CURRENT_DIR} /Dockerfile ${CURRENT_DIR} ; \
97
+ else \
98
+ docker build --no-cache --tag mcad-controller:${TAG} --build-arg GO_BUILD_ARGS=$(GO_BUILD_ARGS ) -f ${CURRENT_DIR} /Dockerfile ${CURRENT_DIR} ; \
99
+ fi \
100
+ fi
89
101
90
102
images-podman : verify-tag-name generate-code update-deployment-crds
91
103
$(info List executable directory)
0 commit comments