-
Notifications
You must be signed in to change notification settings - Fork 4
/
Makefile
43 lines (32 loc) · 1.41 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
43
# By Andrew Paradi | Source at https://github.com/adrw/docker-cs350-os161
DOCKER_COMPOSE=$(shell which docker-compose)
DOCKER_COMPOSE_TARGETS=-f docker-compose.yml
define DOCKER_NICE
trap '$(DOCKER_COMPOSE) $(DOCKER_COMPOSE_TARGETS) down' SIGINT SIGTERM && \
$(DOCKER_COMPOSE) $(DOCKER_COMPOSE_TARGETS)
endef
export DOCKER_NICE
default: pull
init:
build_init: init
bash -c "if [[ ! -f ./docker-compose.yml ]]; then wget https://raw.githubusercontent.com/adrw/docker-os161/master/docker-compose.yml -O docker-compose.yml; fi"
bash -c "if [[ ! -f ./Dockerfile ]]; then wget https://raw.githubusercontent.com/adrw/docker-os161/master/Dockerfile -O Dockerfile; fi"
build: build_init
bash -c "$$DOCKER_NICE build"
# bash -c "rm *.gz"
bash -c "docker run -it -v $(shell pwd)/src:/root/cs350-os161 --entrypoint /bin/bash cs350work_os161"
rebuild: build_init
bash -c "$$DOCKER_NICE build --no-cache"
bash -c "rm *.gz"
bash -c "docker run -it -v $(shell pwd)/src:/root/cs350-os161 --entrypoint /bin/bash cs350work_os161"
run: init
bash -c "docker run -it -v $(shell pwd)/src:/root/cs350-os161 --entrypoint /bin/bash andrewparadi/cs350-os161:latest"
pull: init
bash -c "docker pull andrewparadi/cs350-os161:latest"
bash -c "docker run -it -v $(shell pwd)/src:/root/cs350-os161 --entrypoint /bin/bash andrewparadi/cs350-os161:latest"
down:
bash -c "$$DOCKER_NICE down"
.PHONY: init
.PHONY: build
.PHONY: rebuild
.PHONY: run