All of lore.kernel.org
 help / color / mirror / Atom feed
* [PULL v2 20/24] tests/docker: use direct RUNC call to build containers
@ 2023-03-01 16:43 Akihiro Suda
  2023-03-02 17:05 ` Alex Bennée
  0 siblings, 1 reply; 4+ messages in thread
From: Akihiro Suda @ 2023-03-01 16:43 UTC (permalink / raw)
  To: alex.bennee, qemu-devel

[-- Attachment #1: Type: text/plain, Size: 155 bytes --]

> +               $(RUNC) build                           \

There is no `runc build` command.
Perhaps you meant `$(DOCKER) build`?

Regards,
Akihiro Suda

[-- Attachment #2: Type: text/html, Size: 262 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PULL v2 20/24] tests/docker: use direct RUNC call to build containers
  2023-03-01 16:43 [PULL v2 20/24] tests/docker: use direct RUNC call to build containers Akihiro Suda
@ 2023-03-02 17:05 ` Alex Bennée
  2023-03-02 23:04   ` Akihiro Suda
  0 siblings, 1 reply; 4+ messages in thread
From: Alex Bennée @ 2023-03-02 17:05 UTC (permalink / raw)
  To: Akihiro Suda; +Cc: qemu-devel


Akihiro Suda <suda.kyoto@gmail.com> writes:

>> +               $(RUNC) build                           \
>
> There is no `runc build` command.
> Perhaps you meant `$(DOCKER) build`?

No RUNC is defined in config-host.mak now because it can be docker or
podman.

>
> Regards,
> Akihiro Suda


-- 
Alex Bennée
Virtualisation Tech Lead @ Linaro


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PULL v2 20/24] tests/docker: use direct RUNC call to build containers
  2023-03-02 17:05 ` Alex Bennée
@ 2023-03-02 23:04   ` Akihiro Suda
  0 siblings, 0 replies; 4+ messages in thread
From: Akihiro Suda @ 2023-03-02 23:04 UTC (permalink / raw)
  To: Alex Bennée; +Cc: qemu-devel

[-- Attachment #1: Type: text/plain, Size: 793 bytes --]

> No RUNC is defined in config-host.mak now because it can be docker or
podman.

I feel $(RUNC) isn't the right variable name as it can't be set to "runc".

If $(DOCKER) is not preferable either, $(CONTAINER_ENGINE) might be a
better name.
https://github.com/search?l=Makefile&q=%24%28CONTAINER_ENGINE%29&type=Code


2023年3月3日(金) 2:05 Alex Bennée <alex.bennee@linaro.org>:

>
> Akihiro Suda <suda.kyoto@gmail.com> writes:
>
> >> +               $(RUNC) build                           \
> >
> > There is no `runc build` command.
> > Perhaps you meant `$(DOCKER) build`?
>
> No RUNC is defined in config-host.mak now because it can be docker or
> podman.
>
> >
> > Regards,
> > Akihiro Suda
>
>
> --
> Alex Bennée
> Virtualisation Tech Lead @ Linaro
>

[-- Attachment #2: Type: text/html, Size: 1427 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PULL v2 20/24] tests/docker: use direct RUNC call to build containers
  2023-03-01 15:15 [PULL v2 00/24] testing updates (gitlab, cirrus, docker, avocado, windows) Alex Bennée
@ 2023-03-01 15:16 ` Alex Bennée
  0 siblings, 0 replies; 4+ messages in thread
From: Alex Bennée @ 2023-03-01 15:16 UTC (permalink / raw)
  To: qemu-devel
  Cc: peter.maydell, Alex Bennée, Daniel P . Berrangé,
	Philippe Mathieu-Daudé,
	Thomas Huth, Wainer dos Santos Moschetta, Beraldo Leal

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é <berrange@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
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
-- 
2.39.2



^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-03-02 23:05 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-01 16:43 [PULL v2 20/24] tests/docker: use direct RUNC call to build containers Akihiro Suda
2023-03-02 17:05 ` Alex Bennée
2023-03-02 23:04   ` Akihiro Suda
  -- strict thread matches above, loose matches on Subject: below --
2023-03-01 15:15 [PULL v2 00/24] testing updates (gitlab, cirrus, docker, avocado, windows) Alex Bennée
2023-03-01 15:16 ` [PULL v2 20/24] tests/docker: use direct RUNC call to build containers Alex Bennée

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.