From nobody Tue Feb 10 22:18:12 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zoho.com; dkim=fail spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1498057066102273.9697024787408; Wed, 21 Jun 2017 07:57:46 -0700 (PDT) Received: from localhost ([::1]:54554 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dNh4i-0007jf-UJ for importer@patchew.org; Wed, 21 Jun 2017 10:57:44 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37765) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dNguv-0006j5-Dy for qemu-devel@nongnu.org; Wed, 21 Jun 2017 10:47:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dNgus-00051Q-Tk for qemu-devel@nongnu.org; Wed, 21 Jun 2017 10:47:37 -0400 Received: from mail-wr0-x22a.google.com ([2a00:1450:400c:c0c::22a]:36423) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dNgus-00050n-MS for qemu-devel@nongnu.org; Wed, 21 Jun 2017 10:47:34 -0400 Received: by mail-wr0-x22a.google.com with SMTP id c11so82679900wrc.3 for ; Wed, 21 Jun 2017 07:47:34 -0700 (PDT) Received: from zen.linaro.local ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id 24sm20653140wrw.0.2017.06.21.07.47.30 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 21 Jun 2017 07:47:31 -0700 (PDT) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaro.local (Postfix) with ESMTP id 6AF343E0F68; Wed, 21 Jun 2017 15:48:14 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=bcFC7iMYIw7xrvR1B2fU9IqNnmAG4tibYYaSHK7RHtY=; b=VXSnXCUljBqNDdL50bERKP7CplZaBhhRGWCHZVaUeYJ5yNmaq++GtixbF3eOHKM+W2 FInRC1RLR/lE5CnUYYMitIlBecVA+OzpVWI09oxQ7eB+sZz76ejsu8Ri2vhLVFnY/sup Oljq3Ebx6kC+rBPzLHh5HDQWPFkNtiYAG94pY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=bcFC7iMYIw7xrvR1B2fU9IqNnmAG4tibYYaSHK7RHtY=; b=nOZNLGPJJ74aQApXs14DaOwq3UZ1z0hI3Pv2DrDGqmhybOWqxdAUi+D+SbZ4nBVu1I X1RXemWmOz97oen/92iLxMG93NT2L90HzvZDZNC7xaPUKjQ2SSdq++YJyk/ZTqnoaBHT mbLTzn+RP+SBI0ESmgMtYNhKvDI7bfTMVvhkjAZJ99QMrH94VTPnnaOCCoofi0S9CPlB I9MPDt5Yp/cbWXuQToZEmYSDX0tKlFm4V3INRfeZpOSnXpJogHFEIVnfiJLXuFemJ+r4 WI0EE8F6IyGkSH5aWjdzb1XCTvPRX1vO5SP7uuwlHXPm06wpxaZxH5oae8WWsfzUGZ+8 3eUQ== X-Gm-Message-State: AKS2vOwnvmScMmfOIkNlMkebgRYkU4exZK8zsn1EoxGlh4dJHETmuSkN KJWbic2eZSF9JHQv X-Received: by 10.223.133.186 with SMTP id 55mr13377086wrt.102.1498056453586; Wed, 21 Jun 2017 07:47:33 -0700 (PDT) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: peter.maydell@linaro.org Date: Wed, 21 Jun 2017 15:47:56 +0100 Message-Id: <20170621144814.15324-4-alex.bennee@linaro.org> X-Mailer: git-send-email 2.13.0 In-Reply-To: <20170621144814.15324-1-alex.bennee@linaro.org> References: <20170621144814.15324-1-alex.bennee@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c0c::22a Subject: [Qemu-devel] [PULL 03/21] docker: add --include-files argument to 'build' command X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Fam Zheng , =?UTF-8?q?Alex=20Benn=C3=A9e?= , qemu-devel@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 From: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Alex Benn=C3=A9e Signed-off-by: Alex Benn=C3=A9e diff --git a/tests/docker/Makefile.include b/tests/docker/Makefile.include index 0ed8c3d323..61cc0d14e2 100644 --- a/tests/docker/Makefile.include +++ b/tests/docker/Makefile.include @@ -51,6 +51,7 @@ docker-image-%: $(DOCKER_FILES_DIR)/%.docker $(SRC_PATH)/tests/docker/docker.py build qemu:$* $< \ $(if $V,,--quiet) $(if $(NOCACHE),--no-cache) \ $(if $(NOUSER),,--add-current-user) \ + $(if $(EXTRA_FILES),--extra-files $(EXTRA_FILES))\ $(if $(EXECUTABLE),--include-executable=3D$(EXECUTABLE)),\ "BUILD","$*") =20 @@ -107,6 +108,8 @@ docker: @echo ' NOUSER Define to disable adding current user to = containers passwd.' @echo ' NOCACHE=3D1 Ignore cache when build images.' @echo ' EXECUTABLE=3D Include executable in image.' + @echo ' EXTRA_FILES=3D" [... ]"' + @echo ' Include extra files in image.' =20 # This rule if for directly running against an arbitrary docker target. # It is called by the expanded docker targets (e.g. make diff --git a/tests/docker/docker.py b/tests/docker/docker.py index 6ddc6e4c2a..10fa907905 100755 --- a/tests/docker/docker.py +++ b/tests/docker/docker.py @@ -237,6 +237,10 @@ class BuildCommand(SubCommand): help=3D"""Specify a binary that will be copied= to the container together with all its dependent libraries""") + parser.add_argument("--extra-files", "-f", nargs=3D'*', + help=3D"""Specify files that will be copied in= the + Docker image, fulfilling the ADD directive fro= m the + Dockerfile""") parser.add_argument("--add-current-user", "-u", dest=3D"user", action=3D"store_true", help=3D"Add the current user to image's passwd= ") @@ -270,10 +274,12 @@ class BuildCommand(SubCommand): print "%s exited with code %d" % (docker_pre, rc) return 1 =20 - # Do we include a extra binary? + # Copy any extra files into the Docker context. These can be + # included by the use of the ADD directive in the Dockerfile. if args.include_executable: - _copy_binary_with_libs(args.include_executable, - docker_dir) + _copy_binary_with_libs(args.include_executable, docker_dir) + for filename in args.extra_files or []: + _copy_with_mkdir(filename, docker_dir) =20 argv +=3D ["--build-arg=3D" + k.lower() + "=3D" + v for k, v in os.environ.iteritems() --=20 2.13.0