Skip to content

Commit a89e5ce

Browse files
Merge pull request #431 from signed-log/makefile-oci-patch
2 parents 6304553 + 075cd1b commit a89e5ce

File tree

2 files changed

+14
-8
lines changed

2 files changed

+14
-8
lines changed

.github/CONTRIBUTING.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,11 @@ these principles when making changes.
212212
```text
213213
$ make test
214214
```
215+
If you don't use `docker` but an OCI engine akin to `podman`, you can set it through the `OCI` switch for every target
216+
217+
```text
218+
$ make test OCI=podman
219+
```
215220
216221
5. Create a feature branch, based off the `develop` branch.
217222

Makefile

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
PYTESTS = $(wildcard test/test_*.py)
2-
IMAGE = yadm/testbed:2022-01-07
2+
IMAGE = docker.io/yadm/testbed:2022-01-07
3+
OCI = docker
34

45
.PHONY: all
56
all:
@@ -94,7 +95,7 @@ test:
9495
py.test -v $(testargs); \
9596
else \
9697
$(MAKE) -s require-docker && \
97-
docker run \
98+
$(OCI) run \
9899
--rm -t$(shell test -t 0 && echo i) \
99100
-v "$(CURDIR):/yadm:ro" \
100101
$(IMAGE) \
@@ -117,7 +118,7 @@ test:
117118
.PHONY: testhost
118119
testhost: require-docker .testyadm
119120
@echo "Starting testhost"
120-
@docker run \
121+
@$(OCI) run \
121122
-w /root \
122123
--hostname testhost \
123124
--rm -it \
@@ -129,7 +130,7 @@ testhost: require-docker .testyadm
129130
scripthost: require-docker .testyadm
130131
@echo "Starting scripthost \(recording script\)"
131132
@printf '' > script.gz
132-
@docker run \
133+
@$(OCI) run \
133134
-w /root \
134135
--hostname scripthost \
135136
--rm -it \
@@ -159,7 +160,7 @@ testenv:
159160

160161
.PHONY: image
161162
image:
162-
@docker build -f test/Dockerfile . -t "$(IMAGE)"
163+
@$(OCI) build -f test/Dockerfile . -t "$(IMAGE)"
163164

164165

165166
.PHONY: man
@@ -204,11 +205,11 @@ install:
204205

205206
.PHONY: sync-clock
206207
sync-clock:
207-
docker run --rm --privileged alpine hwclock -s
208+
$(OCI) run --rm --privileged alpine hwclock -s
208209

209210
.PHONY: require-docker
210211
require-docker:
211-
@if ! command -v "docker" > /dev/null 2>&1; then \
212-
echo "Sorry, this make target requires docker to be installed."; \
212+
@if ! command -v $(OCI) > /dev/null 2>&1; then \
213+
echo "Sorry, this make target requires docker to be installed, to use another docker-compatible engine, like podman, re-run the make command adding OCI=podman"; \
213214
false; \
214215
fi

0 commit comments

Comments
 (0)