-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
41 lines (34 loc) · 1.22 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
38
39
40
41
NAME = jancajthaml/nginx
VERSION = latest
.PHONY: all image tag upload publish
all: image
image:
docker build -t $(NAME):stage .
docker run -it $(NAME):stage cat /dev/null
docker export $$(docker ps -a | awk '$$2=="$(NAME):stage" { print $$1 }'| head -1) | docker import - $(NAME):stripped
docker tag $(NAME):stripped $(NAME):$(VERSION)
docker rmi -f $(NAME):stripped
docker rmi -f $(NAME):stage
tag: image
git checkout -B release/$(VERSION)
git add --all
git commit -a --allow-empty-message -m '' 2> /dev/null || :
git rebase --no-ff --autosquash release/$(VERSION)
git pull origin release/$(VERSION) 2> /dev/null || :
git push origin release/$(VERSION)
git checkout -B master
run:
cd example && sh self_signed_certificate.sh
docker run --rm -it --log-driver none \
-p 8080:8080 \
-p 443:443 \
-v $$(pwd)/example/nginx.crt:/etc/nginx/ssl/nginx.crt \
-v $$(pwd)/example/nginx.key:/etc/nginx/ssl/nginx.key \
-v $$(pwd)/example/dhparam.pem:/etc/nginx/ssl/dhparam.pem \
-v $$(pwd)/example/nginx.conf:/etc/nginx/nginx.conf \
-v $$(pwd)/example/index.html:/var/www/index.html \
$(NAME):$(VERSION) nginx
upload:
docker login -u jancajthaml https://index.docker.io/v1/
docker push $(NAME)
publish: image tag upload