Skip to content

Commit

Permalink
Add DOCKER_CMD Makefile var to use podman when found.
Browse files Browse the repository at this point in the history
  • Loading branch information
abutcher committed Jul 24, 2023
1 parent 1f37b78 commit 9c000bd
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
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 9c000bd

Please sign in to comment.