Skip to content

Commit

Permalink
Merge pull request #577 from abutcher/docker-podman
Browse files Browse the repository at this point in the history
Add DOCKER_CMD Makefile var to use podman when found.
  • Loading branch information
openshift-merge-robot committed Jul 25, 2023
2 parents ee553da + 9c000bd commit de95fe7
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion Makefile
Expand Up @@ -16,14 +16,20 @@ include $(addprefix ./vendor/github.com/openshift/build-machinery-go/make/, \
# make images IMAGE_BUILD_EXTRA_FLAGS='-mount ~/projects/origin-repos/4.2/:/etc/yum.repos.d/'
IMAGE_BUILD_EXTRA_FLAGS ?= --no-cache

ifeq ($(shell command -v podman 2> /dev/null),)
DOCKER_CMD=docker
else
DOCKER_CMD=podman
endif

# $1 - target name
# $2 - image ref
# $3 - Dockerfile path
# $4 - context
define build-image-internal
image-$(1):
$(strip \
podman build \
$(DOCKER_CMD) build \
-t $(2) \
-f $(3) \
$(IMAGE_BUILD_EXTRA_FLAGS) \
Expand Down

0 comments on commit de95fe7

Please sign in to comment.