From patchwork Wed Mar 1 15:16:00 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 657811 Delivered-To: patch@linaro.org Received: by 2002:adf:a3c6:0:0:0:0:0 with SMTP id m6csp3544541wrb; Wed, 1 Mar 2023 07:18:42 -0800 (PST) X-Google-Smtp-Source: AK7set8i4XW3jGn8GDPXLaGst//y4G/t6/AgBQhvX/Xxh30VTkrM0azESSb2pRpKrtcggon2yzuV X-Received: by 2002:ac8:7e96:0:b0:3bf:d9d2:484f with SMTP id w22-20020ac87e96000000b003bfd9d2484fmr12769602qtj.11.1677683922244; Wed, 01 Mar 2023 07:18:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677683922; cv=none; d=google.com; s=arc-20160816; b=TRCqhTl/b0RFA2G9noF8CD47c7uVi+lHPnYFx8waUd3bE5e8oXyfKE7Km5JmJLBSAV sTxu4jaAosoxoaz5vyeGYfby3BlJWYn5cZ9hS2t5iIKXKN1oNNd03P4KFxDpnDPk08An I6ql1+KUzOtifzgJ8/tezsSxOohqvjAGVtnn4TFuQ7CZDfNKrDIRYNPh6kVYZDXCwcHh WCbwyQ+b0NZx9adnw8p7NKOj7QOtXFHJrqzpNddkqD+vYEEmr+82uQEFyvwxm/H8wuOz JezHjs8YuC31pX8oFzraLtae8Zb7LvoYo+ZL6+YceURSa00II4KRYKYN/U9bJIT9ulMK YpkQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=EN8jHOsJL7HsIRzzEInBqqC6JRvvYJxy3yPDQt3Nxvo=; b=f4b5sjOL77H8z1XGakCqwvnC5Q4eQB5dR5CO6gsIsAjf4d/4NqfEAcrtJAl+AdeUL+ aRdIVWQ9Ephs//AABZTGkk1997KPsAuguW3ZjcG/O3kppu90vI1sZY083CbEwBcTEEby +mzwIc1HcVLRGHkFUeDI7LdF3WwaW3gk4Ed5r2a0UqJ4ckHS/19plabC/KWwyk6Hpd3d sufOQvYdAScny2H3XboylyL+ucBmFSkdfxHOaE0s3zfGoAP3GMYQG0eMCNQBreRxF40b 7u9jLr4x/YKJrjgQ45Ae53DVlX274xv2CS5sHlAzBZ2LHnEMijRIWZc3Uh/tdgdWqJrc 8rAg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="Vu/qk0Ys"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id t8-20020ac85888000000b003ba260db124si11577919qta.594.2023.03.01.07.18.42 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 01 Mar 2023 07:18:42 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="Vu/qk0Ys"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pXOCH-0000GL-Ea; Wed, 01 Mar 2023 10:16:49 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pXOBk-0008BA-Co for qemu-devel@nongnu.org; Wed, 01 Mar 2023 10:16:16 -0500 Received: from mail-wr1-x42a.google.com ([2a00:1450:4864:20::42a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pXOBh-0007dO-Tt for qemu-devel@nongnu.org; Wed, 01 Mar 2023 10:16:16 -0500 Received: by mail-wr1-x42a.google.com with SMTP id e13so2076285wro.10 for ; Wed, 01 Mar 2023 07:16:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=EN8jHOsJL7HsIRzzEInBqqC6JRvvYJxy3yPDQt3Nxvo=; b=Vu/qk0YsaFyQkQy7Mwk/CHc0/R05ALk3FwnlGEybhN1B/yeUKMVVUIOW1bYsEFc6IL de3V3foZo2+iCaJK+jms3qQsCew1UziReml81XvMFhXHx7TIzXEkV3NFdotUTU0j/GO9 RY9YibqOzjNG2UpmKdux10zVmIlI+CkZ/3YmGCWVUIJDeVjIbLv1LW03j8iy2ZYJ31Y8 iFnVsUWQ2WFf1D/MGzo9s1ztHIyNhSmgCbwXnrVJIUjrcwNjFq4lfU4EN9h1TxApZsJN HxhZ+JTHPAeT8/NPudPANk9iIlwScbMCSL8z5M6Y94dfrTZsUI2j0UmRvcrD9n6/TuOQ WOGw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=EN8jHOsJL7HsIRzzEInBqqC6JRvvYJxy3yPDQt3Nxvo=; b=gYjobkawDaOep1oYzG9DXRvHnEhHYhr18mEtxkGIqiuio7FeT/+YlTnT7N9oCx8DVC jTbhPKmb7rx6RBlIFfBDLnjTPnf5z7YdPTl17JePswQWFv+OpISGyPwAhNg28xrEYL1F 310KYNskv2iz3/ucDYARpitdtP69pysKIKR/WPdnjGtzHeWIAlhBo3EQdEXEqT9jHf/r U6wfYqbN+dmkf2qe2V1mj+gSje/URdy641qGn3PP/Hxx4nxqV708N9o5rLSRYXHiAPPf uhXDm+wcIJUGVQyQvw8u0j5sPF/Zaw8pQgggCbsq1oWUYcOTlwkSo8usP4Mjt8rwdQlO UR2A== X-Gm-Message-State: AO0yUKW6z5kVerD8XRiIqkWdq/Xl3BZauK17/ScBUOwBevX8glOOAc1/ wA1YGReY/GUd0853dtHoeXzHbjfFCHix9jc2 X-Received: by 2002:a05:6000:11c7:b0:2c3:eeeb:b2f7 with SMTP id i7-20020a05600011c700b002c3eeebb2f7mr4919068wrx.62.1677683772535; Wed, 01 Mar 2023 07:16:12 -0800 (PST) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id c2-20020a5d4cc2000000b002bfd524255esm12689441wrt.43.2023.03.01.07.16.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Mar 2023 07:16:11 -0800 (PST) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 1AB9D1FFC8; Wed, 1 Mar 2023 15:16:07 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: peter.maydell@linaro.org, =?utf-8?q?Alex_Benn=C3=A9e?= , =?utf-8?q?Daniel_P_?= =?utf-8?q?=2E_Berrang=C3=A9?= , =?utf-8?q?Philippe_Mat?= =?utf-8?q?hieu-Daud=C3=A9?= , Thomas Huth , Wainer dos Santos Moschetta , Beraldo Leal Subject: [PULL v2 20/24] tests/docker: use direct RUNC call to build containers Date: Wed, 1 Mar 2023 15:16:00 +0000 Message-Id: <20230301151604.1948813-21-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230301151604.1948813-1-alex.bennee@linaro.org> References: <20230301151604.1948813-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42a; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x42a.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org We don't really need stuff from docker.py to do the build as we have everything we need with a direct call. We do rely on the dockerfiles being able to tweak the UID/name mapping as the last step. Reviewed-by: Daniel P. Berrangé Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Alex Bennée Message-Id: <20230228190653.1602033-21-alex.bennee@linaro.org> diff --git a/tests/docker/Makefile.include b/tests/docker/Makefile.include index bfb0dcac21..680afff952 100644 --- a/tests/docker/Makefile.include +++ b/tests/docker/Makefile.include @@ -7,6 +7,8 @@ SPACE := $(NULL) # COMMA := , HOST_ARCH = $(if $(ARCH),$(ARCH),$(shell uname -m)) +USER = $(if $(NOUSER),,$(shell id -un)) +UID = $(if $(NOUSER),,$(shell id -u)) DOCKER_FILES_DIR := $(SRC_PATH)/tests/docker/dockerfiles ifeq ($(HOST_ARCH),x86_64) @@ -14,6 +16,7 @@ DOCKER_DEFAULT_REGISTRY := registry.gitlab.com/qemu-project/qemu endif DOCKER_REGISTRY := $(if $(REGISTRY),$(REGISTRY),$(DOCKER_DEFAULT_REGISTRY)) +RUNC ?= docker ENGINE ?= auto DOCKER_SCRIPT=$(SRC_PATH)/tests/docker/docker.py --engine $(ENGINE) @@ -35,15 +38,17 @@ docker-qemu-src: $(DOCKER_SRC_COPY) # General rule for building docker images. docker-image-%: $(DOCKER_FILES_DIR)/%.docker - $(call quiet-command,\ - $(DOCKER_SCRIPT) build -t qemu/$* -f $< \ - $(if $V,,--quiet) \ - $(if $(NOCACHE),--no-cache, \ - $(if $(DOCKER_REGISTRY),--registry $(DOCKER_REGISTRY))) \ - $(if $(NOUSER),,--add-current-user) \ - $(if $(EXTRA_FILES),--extra-files $(EXTRA_FILES))\ - $(if $(EXECUTABLE),--include-executable=$(EXECUTABLE)),\ - "BUILD","$*") + $(call quiet-command, \ + $(RUNC) build \ + $(if $V,,--quiet) \ + $(if $(NOCACHE),--no-cache, \ + $(if $(DOCKER_REGISTRY),--cache-from $(DOCKER_REGISTRY)/qemu/$*)) \ + --build-arg BUILDKIT_INLINE_CACHE=1 \ + $(if $(NOUSER),, \ + --build-arg USER=$(USER) \ + --build-arg UID=$(UID)) \ + -t qemu/$* - < $<, \ + "BUILD", $1) # Special rule for debootstraped binfmt linux-user images docker-binfmt-image-debian-%: $(DOCKER_FILES_DIR)/debian-bootstrap.docker