docker-alpine-php83-aio/Makefile
Christopher Vagnetoft e2c715b4d4
All checks were successful
dockerbuild / Build docker image (push) Successful in 1m6s
Cleanup
2024-02-06 03:06:27 +01:00

45 lines
1.0 KiB
Makefile

.SILENT:
.PHONY: help
DOCKER_IMAGE = dev.noccylabs.info/noccylabs/alpine-php83-aio:latest
COLOR_RESET = \033[0m
COLOR_INFO = \033[32m
COLOR_COMMENT = \033[33m
### Help
help:
printf "${COLOR_COMMENT}Usage:${COLOR_RESET}\n"
printf " make [target]\n\n"
printf "${COLOR_COMMENT}Available targets:${COLOR_RESET}\n"
awk '/^[a-zA-Z\-\_0-9\.@]+:/ { \
helpMessage = match(lastLine, /^### (.*)/); \
if (helpMessage) { \
helpCommand = substr($$1, 0, index($$1, ":")); \
helpMessage = substr(lastLine, RSTART + 3, RLENGTH); \
printf " ${COLOR_INFO}%-16s${COLOR_RESET} %s\n", helpCommand, helpMessage; \
} \
} \
{ lastLine = $$0 }' $(MAKEFILE_LIST)
.PHONY: docker
### Build docker image
docker:
docker build -t ${DOCKER_IMAGE} .
.PHONY: docker-push
### Publish image
docker-push:
docker push ${DOCKER_IMAGE}
.PHONY: docker-test
### Test docker image
docker-test:
docker run --rm -it ${DOCKER_IMAGE}
.PHONY: docker-shell
### Open a shell in the container
docker-shell:
docker run --rm -it ${DOCKER_IMAGE} sh || true