diff mbox series

[1/2] automation: use DOCKER_CMD for building containers too

Message ID 162133944760.25010.12549941575201320853.stgit@Wayrath (mailing list archive)
State Superseded
Headers show
Series automation: fix building in the openSUSE Tumbleweed | expand

Commit Message

Dario Faggioli May 18, 2021, 12:04 p.m. UTC
From: Dario Faggioli <dario@Solace.fritz.box>

Use DOCKER_CMD from the environment (if defined) in the containers'
makefile too, so that, e.g., when doing `export DOCKED_CMD=podman`
podman is used for building the containers too.

Signed-off-by: Dario Faggioli <dfaggioli@suse.com>
---
Cc: Doug Goldstein <cardoe@cardoe.com>
Cc: Roger Pau Monne <roger.pau@citrix.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>
---
 automation/build/Makefile |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

Comments

Roger Pau Monné May 18, 2021, 2:26 p.m. UTC | #1
On Tue, May 18, 2021 at 02:04:07PM +0200, Dario Faggioli wrote:
> From: Dario Faggioli <dario@Solace.fritz.box>
> 
> Use DOCKER_CMD from the environment (if defined) in the containers'
> makefile too, so that, e.g., when doing `export DOCKED_CMD=podman`
> podman is used for building the containers too.
> 
> Signed-off-by: Dario Faggioli <dfaggioli@suse.com>

Acked-by: Roger Pau Monné <roger.pau@citrix.com>

Thanks!
Dario Faggioli May 18, 2021, 2:35 p.m. UTC | #2
On Tue, 2021-05-18 at 16:26 +0200, Roger Pau Monné wrote:
> On Tue, May 18, 2021 at 02:04:07PM +0200, Dario Faggioli wrote:
> > From: Dario Faggioli <dario@Solace.fritz.box>
> > 
> > Use DOCKER_CMD from the environment (if defined) in the containers'
> > makefile too, so that, e.g., when doing `export DOCKED_CMD=podman`
> > podman is used for building the containers too.
> > 
> > Signed-off-by: Dario Faggioli <dfaggioli@suse.com>
> 
> Acked-by: Roger Pau Monné <roger.pau@citrix.com>
>
Thanks! If it has not been committed yet, can I resend with a From:
that makes sense?

And, either way, sorry for the noise... :-(

Thanks and Regards
diff mbox series

Patch

diff --git a/automation/build/Makefile b/automation/build/Makefile
index 7c7612b1d9..a4b2b85178 100644
--- a/automation/build/Makefile
+++ b/automation/build/Makefile
@@ -2,6 +2,7 @@ 
 # the base of where these containers will appear
 REGISTRY := registry.gitlab.com/xen-project/xen
 CONTAINERS = $(subst .dockerfile,,$(wildcard */*.dockerfile))
+DOCKER_CMD ?= docker
 
 help:
 	@echo "Builds containers for building Xen based on different distros"
@@ -10,9 +11,9 @@  help:
 	@echo "To push container builds, set the env var PUSH"
 
 %: %.dockerfile ## Builds containers
-	docker build -t $(REGISTRY)/$(@D):$(@F) -f $< $(<D)
+	$(DOCKER_CMD) build -t $(REGISTRY)/$(@D):$(@F) -f $< $(<D)
 	@if [ ! -z $${PUSH+x} ]; then \
-		docker push $(REGISTRY)/$(@D):$(@F); \
+		$(DOCKER_CMD) push $(REGISTRY)/$(@D):$(@F); \
 	fi
 
 .PHONY: all