-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
22 lines (18 loc) · 783 Bytes
/
Copy pathMakefile
File metadata and controls
22 lines (18 loc) · 783 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
IMAGE ?= oliverisaac/bash-webserver
TAG ?= latest
.PHONY: build
build:
docker build -t ${IMAGE}:${TAG} .
run: build
if docker container ls -a | grep -q test-img; then docker stop test-img || true; docker rm test-img; fi
docker run -it --name test-img --publish 8080:80 ${IMAGE}:${TAG}
test: build
if docker container ls -a | grep -q test-img; then docker stop test-img || true; docker rm test-img; fi
docker run --name test-img --detach --publish 8080:80 ${IMAGE}:${TAG}
docker logs -f test-img &
sleep 1
echo test | curl -d@- -X GET -v --max-time 5 localhost:8080 || true
echo test | curl -d@- -X GET -v --max-time 5 localhost:8080 || true
echo test | curl -d@- -X GET -v --max-time 5 localhost:8080 || true
docker stop test-img || true
docker rm test-img || true