-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathMakefile
46 lines (31 loc) · 814 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
39
40
41
42
43
44
45
46
#
# Makefile for perfSONAR Toolkit Docker Container
#
NAME=perfsonar/testpoint-docker
GETID=$$(docker ps --format "{{.ID}}" --filter "image=$(NAME)")
default:
@echo Nothing to do by default
# Build the container from scratch
build:
$(GETID) | xargs -r docker rmi -f
docker build \
--no-cache --rm=true \
-t "$(NAME)" \
.
# Start the container
start:
docker run -d -P --net=host $(NAME)
# Start a shell on the container
login:
docker exec -it $(GETID) bash
# Stop the container
stop:
docker kill $(GETID)
# Get rid of the images and containers
remove:
docker ps -a -q | fgrep "$(NAME)" | xargs -r docker stop
docker ps -a -q | fgrep "$(NAME)" | xargs -r docker rm
docker images -a -q | fgrep "$(NAME)" | xargs -r docker rmi
clean:
rm -rf $(TO_CLEAN)
find . -name "*~" | xargs rm -rf