From nobody Tue May 5 10:17:41 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=none dis=none) header.from=vates.tech ARC-Seal: i=1; a=rsa-sha256; t=1777466935; cv=none; d=zohomail.com; s=zohoarc; b=NEQx6ORcU4tW21IFhpalPO1fsIY0GtD0Ixw8MJre2Ar5TUYX9XPnUV/thRT0I5PN9GyJoHLL1kxff1yORZVuMuP0zNbmju9Jt4icmNSZZUhVEtwFGSOa3HfQotZWQ+rBtVD8iK6wdxOkq37hnjvy3VTmJq6SMSNEMvT/ztbDdAo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1777466935; h=Content-Type:Cc:Cc:Date:Date:From:From:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=1YMqeE/bZBZtigC8s9LSwBudS50zC7eOueOUyPah3A4=; b=kq88hV7Um3JE1+tTA3B9Wz8WERR0KzxGFAaaSjfZ0EVsAq+1UKbddNEnvz26LLitHjasVUDebBJe1vEAbYPA2Y7dDAV3GXKyJ9HSaF1t1Culf6kcU8wnEoN3aHqC0xeBJqy1LhsFWTeo9pf83qIuURG2UE2I7xSqg6XSGl4IeWE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1777466935828566.4656944963414; Wed, 29 Apr 2026 05:48:55 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.1297363.1573429 (Exim 4.92) (envelope-from ) id 1wI4L6-0000VO-Dx; Wed, 29 Apr 2026 12:48:28 +0000 Received: by outflank-mailman (output) from mailman id 1297363.1573429; Wed, 29 Apr 2026 12:48:28 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1wI4L6-0000VH-BC; Wed, 29 Apr 2026 12:48:28 +0000 Received: by outflank-mailman (input) for mailman id 1297363; Wed, 29 Apr 2026 12:48:27 +0000 Received: from mx.expurgate.net ([195.190.135.10]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1wI4L4-0000V3-7u for xen-devel@lists.xenproject.org; Wed, 29 Apr 2026 12:48:27 +0000 Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp id 1wI4L3-008hlq-Ha for xen-devel@lists.xenproject.org; Wed, 29 Apr 2026 14:48:25 +0200 Received: from [10.42.69.3] (helo=localhost) by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from ) id 69f1fe16-bab6-0a2a0a5309dd-0a2a4503b75e-14 for ; Wed, 29 Apr 2026 14:48:25 +0200 Received: from [185.255.28.34] (helo=prod-mta-13.swg-srv.net) by tlsNG-33051d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.56.1) (envelope-from ) id 69f1fe18-672d-0a2a45030019-b9ff1c229613-3 for ; Wed, 29 Apr 2026 14:48:25 +0200 Received: from mail2.vates.fr ([37.26.189.201] mail2.vates.fr) (Authenticated sender: 8631fc262581453bbf619ec5b2062170/smtp/7773de5a-2839-4720-82ee-e06722ae1d3e) by prod-mta-13.swg-srv.net (ZoneMTA - prod-mta-13) with ESMTPSA id 19dd9487f12000f373.004 for (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384); Wed, 29 Apr 2026 12:48:20 +0000 Received: from l14.home (lfbn-lyo-1-414-55.w2-7.abo.wanadoo.fr [2.7.24.55]) (Authenticated sender: anthony.perard) by mail2.vates.fr (Postfix) with ESMTPSA id 8D7108076B; Wed, 29 Apr 2026 14:48:15 +0200 (CEST) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=vates.tech header.i="@vates.tech" header.h="From:Subject:Date:Message-ID:To:Cc:MIME-Version:Content-Type:Feedback-ID" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vates.tech; q=dns/txt; s=selector1; bh=1YMqeE/bZBZtigC8s9LSwBudS50zC7eOueOUyPah3A4=; h=from:subject:date:message-id:to:cc:mime-version:content-type:feedback-id; b=KS4kSNS+Lnpgj2C7lHJUVCSP/p0/5iYc8zaXEpll2QT5Xf/kulW1AUsRjpn3e+xtaCfLmJh8Z jfU+LeplQUb2AYCuQ5+3hn9JBS7qmh+J47ZluHPqMXrScVemfRTwhQQsbChtmyuD9vDuveHARLJ nQGhFUnQFS2FXlBlPnfbm16qFpie/c5rPTjhwtod5/3xbjop1oFxL1Y2bTpSxQ+kS8vIKXpA+6O VsJNXJWVB23KzGAV9RM8IzG1832eRKn6yOzjXnMiFM426t/KUqCAq9yIlRNuGJznWmuuFMQCTPE L0WwH6+Tkl9J2y7+ruDtdDAmTKGmcalh3Ufdf+R5lSuw== X-Zone-Loop: 1d80ba4d319fc8bc850ee35a16f7f38b10d1c1a6ea4b x-campaign-type: default x-transaction-id: 0b08aa91-fe12-410f-94d5-abf24be20091 x-swg-uid: 01-c52ddfaf-d2f2-45f3-b171-e8fe60142a53 X-Mailer: Sweego Message-ID: <1777466900.8631fc262581453bbf619ec5b2062170.19dd9487f12000f373@vates.tech> x-swg-bid: 1777466900.8631fc262581453bbf619ec5b2062170.19dd9487f12000f373 Feedback-ID: default:8631fc262581453bbf619ec5b2062170:Sweego x-campaign-id: default x-client-id: 8631fc262581453bbf619ec5b2062170 X-Originating-IP: [37.26.189.201] From: Anthony PERARD To: xen-devel@lists.xenproject.org Cc: Andrew Cooper , Anthony PERARD , Doug Goldstein , Stefano Stabellini Subject: [XEN PATCH] CI: use --platform on `docker build` and `push` Date: Wed, 29 Apr 2026 14:48:01 +0200 MIME-Version: 1.0 X-BM-Disclaimer: Yes Content-Type: multipart/alternative; boundary="-=Part.1e6.370dca10e82feae9.19dd9486d4a.9123d17733a26d6f=-" X-Bm-Milter-Handled: 4ffbd6c1-ee69-4e1b-aabd-f977039bd3e2 X-Bm-Transport-Timestamp: 1777466895694 X-purgate-ID: tlsNG-33051d/1777466905-28F72938-4133C150/0/0 X-purgate-type: clean X-purgate-size: 3376 X-ZohoMail-DKIM: pass (identity @vates.tech) X-ZM-MESSAGEID: 1777466937279158500 ---=Part.1e6.370dca10e82feae9.19dd9486d4a.9123d17733a26d6f=- Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Without --platform, it seems recent versions of docker ignores the platform of the image when pushing, and it's pushed as the platform of the runner. If we happen to build an arm64 image on x86, with recent version of docker, the image will be push as if it was an x86 image, then `docker run --platform=3Dlinux/arm64 ...` fails. Even if it would work without --platform, gitlab-runner will not be able to use the image. To go back to the previous behavior, we will extract --platform from the dockerfiles, and use it on the command line. --platform=3D is needed on both docker-build and docker-push. The first one so that the image is tagged with the right platform, and the second one so that we can push a "generic" image without been tagged to a particular platform. --platform on docker-push allow to easly use the container on any arch, without having to use --platform on docker-pull or docker-run. `docker push --platform` seem to have been added to 1.46, according to the [doc], and doesn't exist on Podman. So we need to check that we are using `docker` and that the API version is new enough. [doc] https://docs.docker.com/reference/cli/docker/image/push/ Also, introduce the $img variable, to make the lines a bit shorter. Signed-off-by: Anthony PERARD --- automation/build/Makefile | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/automation/build/Makefile b/automation/build/Makefile index fedf7524dacd..d578cd347615 100644 --- a/automation/build/Makefile +++ b/automation/build/Makefile @@ -15,10 +15,28 @@ help: =20 include yocto/yocto.inc =20 +# Find out if we are running Podman, if not is likely docker. +is-docker =3D $(if $(filter Podman,$(shell $(DOCKER_CMD) version)),,1) + +# Find out the docker API version is at least 1.46. We exploit `sort -V` to +# compare the versions at it can sort by version. +docker-api-version =3D $(shell $(DOCKER_CMD) version -f '{{.Client.APIVers= ion}}') +docker-min-version =3D $(firstword $(shell printf "1.46\n$(docker-api-vers= ion)" | sort -V)) +docker-have-push-platform =3D $(if $(filter 1.46,$(docker-min-version)),1) + +# check if we can use `X push --platform`. +# `podman push` doesn't support --platform. +# `docker` only have it on recent version. +builder-have-push-platform =3D $(and $(is-docker),$(docker-have-push-platf= orm)) + %: %.dockerfile ## Builds containers - $(DOCKER_CMD) build --pull -t $(REGISTRY)/$(@D):$(@F) -f $< $(