tools: add --platform arg when possible
make script more resilient/cross-platform
This commit is contained in:
@@ -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} \
|
||||
|
||||
@@ -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}" \
|
||||
|
||||
@@ -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}" \
|
||||
|
||||
@@ -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}" \
|
||||
|
||||
Reference in New Issue
Block a user