Change docker commands to $(ENGINE)

Change docker commands to $(ENGINE) to use podman when needed

Change-Id: I9441c8e8c0a729fd48602c4f4f27431324874e81
This commit is contained in:
frenzyfriday 2022-05-11 11:05:15 +02:00
parent 7780f975a8
commit e871f253f9
1 changed files with 6 additions and 2 deletions

View File

@ -44,11 +44,11 @@ ifndef GERRIT_USER
endif
.PHONY: build
build: data/id_rsa check-env ## Build image using docker
build: data/id_rsa check-env ## Build image using $(ENGINE)
@echo "Checking that current user can connect to gerit using ssh..."""
@python3 ./tools/ssh-check.py
$(ENGINE) build -t $(IMAGE_TAG) .
@echo "Image size: $$(docker image inspect --format='scale=0; {{.Size}}/1024/1024' $(IMAGE_TAG) | bc)MB"
@echo "Image size: $$($(ENGINE) image inspect --format='scale=0; {{.Size}}/1024/1024' $(IMAGE_TAG) | bc)MB"
@echo "Validate that built container can also connect to gerrit..."""
$(ENGINE) run --env GERRIT_USER -it $(IMAGE_TAG) python3 /root/ssh-check.py
@ -62,6 +62,10 @@ up: data/id_rsa check-env ## Run containers
@# docker container stop elastic-recheck
@# bash -c "docker rm elastic-recheck || true"
@# docker run --env ES_URL --env LS_URL --env DB_URI --env GERRIT_HOST --env GERRIT_USER --env IRC_NICK --env IRC_PASS -it --name elastic-recheck elastic-recheck:latest
docker-compose up --force-recreate --remove-orphans --abort-on-container-exit <<<y
@# $(ENGINE) container stop elastic-recheck
@# bash -c "$(ENGINE) rm elastic-recheck || true"
@# $(ENGINE) run --env ES_URL --env LS_URL --env DB_URI --env GERRIT_HOST --env GERRIT_USER --env IRC_NICK --env IRC_PASS -it --name elastic-recheck elastic-recheck:latest
.PHONY: down
down: ## Destroy containers