From 2a060fb972a76de1ad47b7a2d537885813238b89 Mon Sep 17 00:00:00 2001 From: Ron Rise Date: Sat, 27 Dec 2025 19:56:02 -0500 Subject: [PATCH] Docker build make target --- makefile | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/makefile b/makefile index 2354957..206a8e2 100644 --- a/makefile +++ b/makefile @@ -43,6 +43,26 @@ help: ## Show this help @echo "$(SPARK) Available commands:" @awk -F':|##' '/^[a-zA-Z0-9._-]+:.*##/ {printf " %-$(HELP_COL_WIDTH)s - %s\n", $$1, $$3}' $(MAKEFILE_LIST) | sort +docker-build: ## Build Docker image + @push_flag=""; \ + if [ -n "$(push)" ]; then \ + push="--push"; \ + fi + @if [ -z "$(image)" ]; then \ + echo "image variable is required: make docker-build image=your-image-name tag=your"; \ + exit 1; \ + fi + @if [ -z "$(tag)" ]; then \ + echo "tag variable is required: make docker-build image=your-image-name tag=your"; \ + exit 1; \ + fi + @platform_flag=""; \ + if [ -n "$(platform)" ]; then \ + platform_flag="--platform=$(platform)"; \ + fi; \ + printf "$(YELLOW)$(SPARK) Building Docker image: $(image):$(tag)$(RESET)\n"; \ + docker buildx build $$platform_flag --provenance=true --sbom=true $$push_flag --tag $(image):$(tag) . + start: ## Start the development runtime container @printf "$(GREEN)$(ROCKET) Starting $(DEV_RUNTIME)$(RESET)\n" $(DOCKER) up $(DEV_RUNTIME) -d --no-recreate @@ -164,4 +184,4 @@ ci: composer-install migrate license-check lint test ## CI-like local flow down: stop ## Alias for stop up: start ## Alias for start -.PONY: help start sh run stop restart rebuild ps migrate composer-install composer-require composer-require-dev composer-update enable-debug enable-coverage protoc license-check lint fmt test test-coverage dev ci down up \ No newline at end of file +.PHONY: help start sh run stop docker-build restart rebuild ps migrate composer-install composer-require composer-require-dev composer-update enable-debug enable-coverage protoc license-check lint fmt test test-coverage dev ci down up \ No newline at end of file