-
Notifications
You must be signed in to change notification settings - Fork 7
/
Makefile
38 lines (27 loc) · 818 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
38
# include env_make
NS = danjellz
VERSION ?= latest
REPO = http-server
NAME = http-server
PORTS = -p 8080:8080
VOLUMES = -v ${PWD}:/public
BUILD_ARGS=--build-arg VCS_REF=`git rev-parse --short HEAD` \
--build-arg BUILD_DATE=`date -u +"%Y-%m-%dT%H:%M:%SZ"`
.PHONY: build push shell run start stop rm release
build:
docker build -t $(NS)/$(REPO):$(VERSION) $(BUILD_ARGS) $(ARGS) .
push:
docker push $(NS)/$(REPO):$(VERSION)
shell:
docker run -it --rm --name $(NAME) $(PORTS) $(VOLUMES) $(ENV) $(NS)/$(REPO):$(VERSION) sh
run:
docker run -it --rm --name $(NAME) $(PORTS) $(VOLUMES) $(ENV) $(NS)/$(REPO):$(VERSION)
start:
docker run -d --name $(NAME) $(VOLUMES) $(ENV) $(NS)/$(REPO):$(VERSION)
stop:
docker stop $(NAME)
rm:
docker rm $(NAME)
release: build
make push -e VERSION=$(VERSION)
default: build