-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMakefile
26 lines (20 loc) · 943 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
IMAGE?=ghcr.io/fabioassuncao/php
VERSION?=8.3
DOCKER_RUN:=docker run --rm ${IMAGE}:${VERSION}
DEFAULT_ARCHS?=linux/amd64
help:
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "⚡ \033[34m%-30s\033[0m %s\n", $$1, $$2}'
build: ## Build docker image
docker buildx build --load --platform $(DEFAULT_ARCHS) -t $(IMAGE):${VERSION} -f php/${VERSION}/Dockerfile php/${VERSION}/
release: ### Build and push image to Registry
echo "Releasing: ${IMAGE}${VERSION}"
docker buildx build --push --platform $(DEFAULT_ARCHS) -t $(IMAGE):${VERSION} -f php/${VERSION}/Dockerfile php/${VERSION}/
release-all: ### Build all PHP version and push image to Registry
echo "Releasing all PHP version"
VERSION=8.3 make release
test: ### Test image
$(DOCKER_RUN) php -v
$(DOCKER_RUN) sh -c "php -v | grep ${VERSION}"
$(DOCKER_RUN) sh -c "nginx -t"
test-all: ### Test all image
VERSION=8.3 make build test