mirror of
https://github.com/artvs18/PostgreSQL-docker-image.git
synced 2025-05-29 21:47:54 +02:00
29 lines
1.2 KiB
Makefile
29 lines
1.2 KiB
Makefile
IMAGE?=artvs18/postgres
|
|
TAG?=latest
|
|
|
|
BUILDER=buildx-multi-arch
|
|
|
|
INFO_COLOR = \033[0;36m
|
|
NO_COLOR = \033[m
|
|
|
|
build-extension: ## Build service image to be deployed as a desktop extension
|
|
docker build --tag=$(IMAGE):$(TAG) .
|
|
|
|
install-extension: build-extension ## Install the extension
|
|
docker extension install $(IMAGE):$(TAG)
|
|
|
|
update-extension: build-extension ## Update the extension
|
|
docker extension update $(IMAGE):$(TAG)
|
|
|
|
prepare-buildx: ## Create buildx builder for multi-arch build, if not exists
|
|
docker buildx inspect $(BUILDER) || docker buildx create --name=$(BUILDER) --driver=docker-container --driver-opt=network=host
|
|
|
|
push-extension: prepare-buildx ## Build & Upload extension image to hub. Do not push if tag already exists: make push-extension tag=0.1
|
|
docker pull $(IMAGE):$(TAG) && echo "Failure: Tag already exists" || docker buildx build --push --builder=$(BUILDER) --platform=linux/amd64,linux/arm64 --build-arg TAG=$(TAG) --tag=$(IMAGE):$(TAG) .
|
|
|
|
help: ## Show this help
|
|
@echo Please specify a build target. The choices are:
|
|
@grep -E '^[0-9a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "$(INFO_COLOR)%-30s$(NO_COLOR) %s\n", $$1, $$2}'
|
|
|
|
.PHONY: help
|