forked from tgmti/docker-pdi
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
38 lines (33 loc) · 881 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
# pull in any overrides to IMAGE from the .env file
ifneq (,$(wildcard ./.env))
include .env
export
endif
IMAGE?=pdi
APP=spoon
DOCKERFILE?=Dockerfile
.PHONY: help
help:
@echo "Usage: make [target]"
@echo
@echo "Targets:"
@echo " help\t\tPrint this help"
@echo " test\t\tLookup for docker binary"
@echo " setup [DOCKERFILE]\tBuild docker image defined in '\$$DOCKERFILE' (Dockerfile by default)"
@echo " run [app]\tRun app defined in '\$$APP' (spoon by default)"
@echo ""
@echo "Example: make run APP=spoon"
.PHONY: test
test:
@which docker
@which xauth
.PHONY: setup
setup: $(DOCKERFILE)
docker image build -t $(IMAGE) -f $(DOCKERFILE) .
.PHONY: run
run:
@echo $(APP)
docker run -it --rm -v /tmp/.X11-unix/:/tmp/.X11-unix/:ro \
-v $$(pwd):/root/data \
-e XAUTH=$$(xauth list|grep `uname -n` | cut -d ' ' -f5) -e "DISPLAY" \
$(IMAGE) $(APP)