-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
36 lines (25 loc) · 849 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
#
#*******************************************************************************
# Contributors:
# Ranjan Dasgupta - initial drop
#
#*******************************************************************************/
#
export DOCKER_IMAGE_NAME ?= test-http-server
export DOCKER_IMAGE_VERSION ?= 1.0
export DOCKER_IMAGE_PATH ?= $(DOCKER_IMAGE_NAME):$(DOCKER_IMAGE_VERSION)
default: all
all: build run check
build:
@echo $$DOCKER_IMAGE_NAME
docker build -t $(DOCKER_IMAGE_PATH) -f ./Dockerfile .
run:
-docker rm -f $(DOCKER_IMAGE_NAME) 2> /dev/null
docker run -d --name $(DOCKER_IMAGE_NAME) -p 8080:8080 $(DOCKER_IMAGE_PATH)
check:
docker logs -f $(DOCKER_IMAGE_NAME)
stop:
-docker stop $(DOCKER_IMAGE_NAME) 2> /dev/null
clean:
-docker rm -f -v $(DOCKER_IMAGE_NAME) 2> /dev/null
-docker rmi -f $(DOCKER_IMAGE_PATH) 2> /dev/null