File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -10,6 +10,16 @@ SHELL := /usr/bin/env bash
10
10
# Print the help/usage when make is executed without any other arguments
11
11
.DEFAULT_GOAL := help
12
12
13
+ # CRI_BIN is the path to the container runtime binary.
14
+ ifeq (,$(strip $(GITHUB_RUN_ID ) ) )
15
+ # Prefer podman locally.
16
+ CRI_BIN := $(shell command -v podman 2>/dev/null || command -v docker 2>/dev/null)
17
+ else
18
+ # Prefer docker in GitHub actions.
19
+ CRI_BIN := $(shell command -v docker 2>/dev/null || command -v podman 2>/dev/null)
20
+ endif
21
+ export CRI_BIN
22
+
13
23
14
24
# # --------------------------------------
15
25
# # Help
@@ -30,7 +40,7 @@ IMAGE ?= $(IMAGE_NAME):$(IMAGE_TAG)
30
40
31
41
.PHONY : image-build
32
42
image-build : # # Build the image for generating types
33
- docker build -t $(IMAGE ) .
43
+ $( CRI_BIN ) build -t $(IMAGE ) .
34
44
35
45
36
46
# # --------------------------------------
@@ -49,7 +59,7 @@ ABS_PATH_PARENT_DIR := $(abspath $(dir $(shell pwd)))
49
59
generate-types : image-build
50
60
generate-types : # # Generate the types
51
61
@cp -f Gemfile.lock .Gemfile.lock.tmp
52
- docker run -it --rm \
62
+ $( CRI_BIN ) run -it --rm \
53
63
-v $(ABS_PATH_PARENT_DIR ) :/govmomi \
54
64
-v $(ABS_PATH_PARENT_DIR ) /gen/.Gemfile.lock.tmp:/govmomi/gen/Gemfile.lock \
55
65
$(IMAGE ) \
You can’t perform that action at this time.
0 commit comments