Skip to content

Commit da350e3

Browse files
Add configurable container runtime variable to Makefile (#893)
### What Introduce a `CONTAINER_RUNTIME` variable that defaults to `docker` but can be overridden to use alternative runtimes like `podman`. Replace hardcoded `docker` commands in `run`, `logs`, `console`, and `build` targets with this variable. ### Why Allow users with different container runtimes to use the Makefile without modification.
1 parent 71a6a2f commit da350e3

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

Makefile

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
__PHONY__: run logs console build build-deps build-deps-xdr build-deps-core build-deps-horizon build-deps-friendbot build-deps-rpc build-deps-lab test
22

3+
CONTAINER_RUNTIME?=docker
34
REVISION=$(shell git -c core.abbrev=no describe --always --exclude='*' --long --dirty)
45
TAG?=latest
56

@@ -28,16 +29,16 @@ LAB_REPO = $(shell < $(IMAGE_JSON) jq -r '.deps[] | select(.name == "la
2829
LAB_SHA = $(shell < $(IMAGE_JSON) jq -r '.deps[] | select(.name == "lab") | .sha')
2930

3031
run:
31-
docker run --rm -i --name stellar -p 8000:8000 -p 11626:11626 stellar/quickstart:$(TAG) --local
32+
$(CONTAINER_RUNTIME) run --rm -i --name stellar -p 8000:8000 -p 11626:11626 stellar/quickstart:$(TAG) --local
3233

3334
logs:
34-
docker exec stellar /bin/sh -c 'tail -F /var/log/supervisor/*'
35+
$(CONTAINER_RUNTIME) exec stellar /bin/sh -c 'tail -F /var/log/supervisor/*'
3536

3637
console:
37-
docker exec -it stellar /bin/bash
38+
$(CONTAINER_RUNTIME) exec -it stellar /bin/bash
3839

3940
build: $(IMAGE_JSON)
40-
docker build -t stellar/quickstart:$(TAG) -f Dockerfile . \
41+
$(CONTAINER_RUNTIME) build -t stellar/quickstart:$(TAG) -f Dockerfile . \
4142
--build-arg REVISION=$(REVISION) \
4243
--build-arg XDR_REPO=$(XDR_REPO) --build-arg XDR_REF=$(XDR_SHA) \
4344
--build-arg CORE_REPO="$(CORE_REPO)" --build-arg CORE_REF="$(CORE_SHA)" --build-arg CORE_OPTIONS='$(CORE_OPTIONS)' \

0 commit comments

Comments
 (0)