From 1fdd62fe1107b13757ae42dce45709a41d0f8456 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Zaroda?= Date: Wed, 14 Aug 2024 00:32:26 +0200 Subject: [PATCH] Made "deploy-image" Makefile's target push a multi arch image. --- Makefile | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 675083c..516ec9a 100644 --- a/Makefile +++ b/Makefile @@ -18,6 +18,8 @@ DIST_BIN_PATH = ${DIST_PATH}/bin DRAKY_BIN_PATH = ${DIST_BIN_PATH}/draky TESTS_PATH = ${ROOT}/tests +PLATFORMS=linux/arm64,linux/amd64 + # Version processed. VER = $(shell echo ${VERSION} | sed 's/^v//g') @@ -93,6 +95,10 @@ cleanup: deploy-image: if [ "${VERSION}" == "${VERSION_DEFAULT}" ]; then \ echo "Cannot deploy the '${VERSION_DEFAULT}' version"; \ - else \ - docker push ${NAME}:${VER}; \ + exit; \ fi; + [ ! -d "${DIST_PATH}" ] || rm -r ${DIST_PATH} + mkdir -p ${DIST_BIN_PATH} + docker buildx create --use --name docker-container + docker buildx build -f ${ROOT}/Dockerfile --provenance=false --rm --platform ${PLATFORMS} -t ${NAME}:${VER} --output "type=registry" . + docker buildx rm docker-container