-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
42 lines (32 loc) · 1.01 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
42
include version.env
ACCOUNT=platec
CONTAINER=roud
VERSION=${VERSION_TAG}
.PHONY: build
build: ## build the web-app container image
docker build -t ${ACCOUNT}/${CONTAINER}:${VERSION} .
.PHONY: run
run: ## run a container instance with the freshly built image
docker run -p 80:80 --name roud ${ACCOUNT}/${CONTAINER}:${VERSION}
.PHONY: start
start: ## re-start an existing container instance (form a previous `run`)
docker start roud
.PHONY: stop
stop: ## stop the docker container instance
docker stop roud
.PHONY: rm
rm: ## remove the docker container instance
docker rm roud
.PHONY: rmi
rmi: ## remove the built container image
docker rmi ${ACCOUNT}/${CONTAINER}:${VERSION}
.PHONY: login
login: ## docker hub login
docker login -u ${ACCOUNT}
.PHONY: push
push: ## push the image to docker hub
docker push ${ACCOUNT}/${CONTAINER}:${VERSION}
.PHONY: help
help: ## this help
@awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z_-]+:.*?## / {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST) | sort
.DEFAULT_GOAL := help