2025-02-20 16:14:54 +01:00

33 lines
813 B
Makefile

IMAGE_NAME = debian-iac
IMAGE_TAG = latest
DOCKER_REGISTRY = git.mziesel.nl
REPO_OWNER = mans
# Default target
.PHONY: all
all: build
# Build the Docker image
.PHONY: build
build:
docker build -t $(DOCKER_REGISTRY)/$(REPO_OWNER)/$(IMAGE_NAME):$(IMAGE_TAG) .
# Push the Docker image to the registry
.PHONY: push
push: build
docker push $(DOCKER_REGISTRY)/$(REPO_OWNER)/$(IMAGE_NAME):$(IMAGE_TAG)
# Clean up local images
.PHONY: clean
clean:
docker rmi $(DOCKER_REGISTRY)/$(REPO_OWNER)/$(IMAGE_NAME):$(IMAGE_TAG) || true
# Help message
.PHONY: help
help:
@echo "Makefile commands:"
@echo " make build - Build the Docker image"
@echo " make push - Push the Docker image to the registry"
@echo " make clean - Remove local images"
@echo " make help - Show this help message"