tools: add --platform arg when possible

make script more resilient/cross-platform
This commit is contained in:
Corentin Le Molgat
2023-11-16 18:17:12 +01:00
parent 7f48cd9a9a
commit 857c353f71
4 changed files with 7 additions and 6 deletions

View File

@@ -212,7 +212,7 @@ define manylinux_inner =
.PHONY: python_$1_manylinux_cp$2_$3
python_$1_manylinux_cp$2_$3: python/$1/manylinux.Dockerfile export/python/manylinux/build-manylinux.sh
@docker image rm -f ${IMAGE}:$$@ 2>/dev/null
${DOCKER_BUILD_CMD} \
${DOCKER_BUILDX_CMD} --platform linux/$1 \
--tag ${IMAGE}:$$@ \
--build-arg GIT_BRANCH=${OR_TOOLS_BRANCH} \
--build-arg GIT_SHA1=${OR_TOOLS_SHA1} \

View File

@@ -73,8 +73,9 @@ function build_delivery() {
cd "${RELEASE_DIR}" || exit 2
# Build env
# https://github.com/containerd/containerd/blob/v1.4.3/platforms/platforms.go#L63
echo -n "Build ${ORTOOLS_IMG}:env..." | tee -a "${ROOT_DIR}/build.log"
docker buildx build \
docker buildx build --platform linux/amd64 \
--tag "${ORTOOLS_IMG}":env \
--build-arg ORTOOLS_GIT_BRANCH="${ORTOOLS_BRANCH}" \
--build-arg ORTOOLS_GIT_SHA1="${ORTOOLS_SHA1}" \
@@ -84,7 +85,7 @@ function build_delivery() {
# Build devel
echo -n "Build ${ORTOOLS_IMG}:devel..." | tee -a "${ROOT_DIR}/build.log"
docker buildx build \
docker buildx build --platform linux/amd64 \
--tag "${ORTOOLS_IMG}":devel \
--build-arg ORTOOLS_GIT_BRANCH="${ORTOOLS_BRANCH}" \
--build-arg ORTOOLS_GIT_SHA1="${ORTOOLS_SHA1}" \
@@ -94,7 +95,7 @@ function build_delivery() {
# Build delivery
echo -n "Build ${ORTOOLS_IMG}:${ORTOOLS_DELIVERY}..." | tee -a "${ROOT_DIR}/build.log"
docker buildx build \
docker buildx build --platform linux/amd64 \
--tag "${ORTOOLS_IMG}":"${ORTOOLS_DELIVERY}" \
--build-arg ORTOOLS_GIT_BRANCH="${ORTOOLS_BRANCH}" \
--build-arg ORTOOLS_GIT_SHA1="${ORTOOLS_SHA1}" \

View File

@@ -70,7 +70,7 @@ function publish_delivery() {
# Publish delivery
echo -n "Build ${ORTOOLS_IMG}:publish_${ORTOOLS_DELIVERY}..." | tee -a "${ROOT_DIR}/publish.log"
docker buildx build \
docker buildx build --platform linux/amd64 \
--tag "${ORTOOLS_IMG}":"publish_${ORTOOLS_DELIVERY}" \
--build-arg ORTOOLS_GIT_BRANCH="${ORTOOLS_BRANCH}" \
--build-arg ORTOOLS_GIT_SHA1="${ORTOOLS_SHA1}" \

View File

@@ -70,7 +70,7 @@ function publish_delivery() {
# Publish delivery
echo -n "Build ${ORTOOLS_IMG}:publish_${ORTOOLS_DELIVERY}..." | tee -a "${ROOT_DIR}/publish.log"
docker buildx build \
docker buildx build --platform linux/arm64 \
--tag "${ORTOOLS_IMG}":"publish_${ORTOOLS_DELIVERY}" \
--build-arg ORTOOLS_GIT_BRANCH="${ORTOOLS_BRANCH}" \
--build-arg ORTOOLS_GIT_SHA1="${ORTOOLS_SHA1}" \