Files
xen/automation/build/Makefile
T
Dario Faggioli 65538153a6 automation: use DOCKER_CMD for building containers too
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>
2021-05-19 19:21:07 +01:00

21 lines
655 B
Makefile

# 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"
@echo "To build one run 'make DISTRO/VERSION'. Available containers:"
@$(foreach file,$(sort $(CONTAINERS)),echo ${file};)
@echo "To push container builds, set the env var PUSH"
%: %.dockerfile ## Builds containers
$(DOCKER_CMD) build -t $(REGISTRY)/$(@D):$(@F) -f $< $(<D)
@if [ ! -z $${PUSH+x} ]; then \
$(DOCKER_CMD) push $(REGISTRY)/$(@D):$(@F); \
fi
.PHONY: all
all: $(CONTAINERS)