-
Notifications
You must be signed in to change notification settings - Fork 19
/
Makefile
37 lines (27 loc) · 854 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
27
28
29
30
31
32
33
34
35
36
37
DIR = .
FILE = Dockerfile
IMAGE = devilbox/php-fpm-7.4
TAG = latest
.PHONY: build rebuild test tag pull login push enter
update-readme:
cat "./README.md" \
| perl -00 -pe "s/<!-- modules -->.*<!-- \/modules -->/<!-- modules -->\n$$(./tests/get-modules.sh)\n<!-- \/modules -->/s" \
> "./README.md.tmp"
yes | mv -f "./README.md.tmp" "./README.md"
build:
docker build -t $(IMAGE) -f $(DIR)/$(FILE) $(DIR)
rebuild: pull
docker build --no-cache -t $(IMAGE) -f $(DIR)/$(FILE) $(DIR)
test:
./tests/test.sh $(IMAGE)
tag:
docker tag $(IMAGE) $(IMAGE):$(TAG)
pull:
docker pull $(shell grep FROM Dockerfile | sed 's/^FROM//g';)
login:
yes | docker login --username $(USER) --password $(PASS)
push:
@$(MAKE) tag TAG=$(TAG)
docker push $(IMAGE):$(TAG)
enter:
docker run --rm --name $(subst /,-,$(IMAGE)) -it --entrypoint=bash $(ARG) $(IMAGE)