organic/docker/cargo_fmt/Makefile

36 lines
695 B
Makefile
Raw Permalink Normal View History

2023-07-11 10:49:08 +00:00
IMAGE_NAME:=cargo-fmt
# REMOTE_REPO:=harbor.fizz.buzz/private
.PHONY: all
all: build push
.PHONY: build
build:
docker build -t $(IMAGE_NAME) -f Dockerfile ../../
2023-07-11 10:49:08 +00:00
.PHONY: push
push:
ifdef REMOTE_REPO
docker tag $(IMAGE_NAME) $(REMOTE_REPO)/$(IMAGE_NAME)
docker push $(REMOTE_REPO)/$(IMAGE_NAME)
else
@echo "REMOTE_REPO not defined, not pushing to a remote repo."
endif
.PHONY: clean
clean:
docker rmi $(IMAGE_NAME)
ifdef REMOTE_REPO
docker rmi $(REMOTE_REPO)/$(IMAGE_NAME)
else
@echo "REMOTE_REPO not defined, not removing from remote repo."
endif
.PHONY: run
run:
docker run --rm -i -t $(IMAGE_NAME)
.PHONY: shell
shell:
docker run --rm -i -t --entrypoint /bin/bash $(IMAGE_NAME)