-
Notifications
You must be signed in to change notification settings - Fork 16
/
Makefile
37 lines (31 loc) · 1.26 KB
/
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
27
28
29
30
31
32
33
34
35
36
37
IMAGE?=pnlinh/laravel:php
DOCKER_RUN:=docker run --rm ${IMAGE}${VERSION}
DEFAULT_ARCHS?=linux/arm64
ARCHS?=linux/amd64,linux/arm64,linux/arm/v8,linux/arm/v7,linux/arm/v6
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 ${VERSION}/Dockerfile ${VERSION}/
release: ### Build and push image to DockerHub
echo "Releasing: ${IMAGE}${VERSION}"
docker buildx build --push --platform $(ARCHS) -t $(IMAGE)${VERSION} -f ${VERSION}/Dockerfile ${VERSION}/
release-all: ### Build all PHP version and push image to DockerHub
echo "Releasing all PHP version"
VERSION=8.3 make release
VERSION=8.2 make release
VERSION=8.1 make release
VERSION=8.0 make release
VERSION=7.4 make release
VERSION=7.2 make release
test: ### Test image
$(DOCKER_RUN) php -v
$(DOCKER_RUN) sh -c "php -v | grep ${VERSION}"
$(DOCKER_RUN) sh -c "php -v | grep OPcache"
$(DOCKER_RUN) sh -c "nginx -t"
test-all: ### Test all image
VERSION=8.3 make build test
VERSION=8.2 make build test
VERSION=8.1 make build test
VERSION=8.0 make build test
VERSION=7.4 make build test
VERSION=7.2 make build test