Skip to content

Commit

Permalink
Add make task support for alternate container runtimes like Podman (T…
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathanfoster committed Oct 3, 2024
1 parent ed74e28 commit 4054a54
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ TEST_COUNT=1
BENCH_REGEX=.
BENCH_RUN=NONE

DOCKER_CMD?=docker

.PHONY: test
test:
$(GOTEST) -run=$(TEST_REGEX) -count=$(TEST_COUNT) ./...
Expand Down Expand Up @@ -62,34 +64,34 @@ db-stop: redis-stop mongo-stop
# Docker start redis
.PHONY: redis-start
redis-start:
docker run -itd --rm --name redis -p 127.0.0.1:6379:6379 redis:4.0-alpine redis-server --appendonly yes
$(DOCKER_CMD) run -itd --rm --name redis -p 127.0.0.1:6379:6379 redis:4.0-alpine redis-server --appendonly yes

.PHONY: redis-stop
redis-stop:
docker stop redis
$(DOCKER_CMD) stop redis

.PHONY: redis-cli
redis-cli:
docker exec -it redis redis-cli
$(DOCKER_CMD) exec -it redis redis-cli

# Docker start mongo
.PHONY: mongo-start
mongo-start:
docker run -itd --rm --name mongo -p 127.0.0.1:27017:27017 mongo:3.4-jessie
$(DOCKER_CMD) run -itd --rm --name mongo -p 127.0.0.1:27017:27017 mongo:3.4-jessie

.PHONY: mongo-stop
mongo-stop:
docker stop mongo
$(DOCKER_CMD) stop mongo

.PHONY: mongo-shell
mongo-shell:
docker exec -it mongo mongo

.PHONY: docker docker-std
$(DOCKER_CMD) exec -it mongo mongo

.PHONY: docker
docker:
docker build --platform ${BUILD_PLATFORM} --rm -t internal/tyk-gateway .
$(DOCKER_CMD) build --platform ${BUILD_PLATFORM} --rm -t internal/tyk-gateway .

.PHONY: docker-std
docker-std: build
docker build --platform ${BUILD_PLATFORM} --no-cache -t internal/tyk-gateway:std -f ci/Dockerfile.std .
$(DOCKER_CMD) build --platform ${BUILD_PLATFORM} --no-cache -t internal/tyk-gateway:std -f ci/Dockerfile.std .

0 comments on commit 4054a54

Please sign in to comment.