-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathMakefile
More file actions
37 lines (26 loc) · 1.07 KB
/
Makefile
File metadata and controls
37 lines (26 loc) · 1.07 KB
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
NAME = php-apache
TAG = $(shell basename $(shell pwd))
IMAGE_NAME := panubo/$(NAME)
.PHONY: help build buildarm buildamd push clean bash run
help:
@printf "$$(grep -hE '^\S+:.*##' $(MAKEFILE_LIST) | sed -e 's/:.*##\s*/:/' -e 's/^\(.\+\):\(.*\)/\\x1b[36m\1\\x1b[m:\2/' | column -c2 -t -s :)\n"
build: ## build image
docker build --pull -t $(IMAGE_NAME):$(TAG) .
buildarm: ## build image
docker build --platform=linux/arm64 --pull -t $(IMAGE_NAME):$(TAG) .
buildamd: ## build image
docker build --platform=linux/amd64 --pull -t $(IMAGE_NAME):$(TAG) .
push: ## Push image to registry
docker tag $(IMAGE_NAME):$(TAG) docker.io/$(IMAGE_NAME):latest
docker push $(IMAGE_NAME):$(TAG)
docker push $(IMAGE_NAME):latest
clean: ## Remove built image
docker rmi $(IMAGE_NAME):$(TAG)
bash: ## Runs bash in the container
docker run --rm -it -v $(shell pwd)/test:/srv/remote $(IMAGE_NAME):$(TAG) bash
run: ## Runs the container with test data
docker run --rm -it -p 8000:8000 -v $(shell pwd)/test:/srv/remote --name $(NAME) $(IMAGE_NAME):$(TAG)
_ci_test:
true
_ci_version:
@echo $(TAG)