forked from Weilkiti/sysmlv2-jupyter-docker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
60 lines (47 loc) · 1.83 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# SysMLv2 Release to use.
release = 2021-02
##
## Local setup
##
.PHONY: build-api
build-api: ## build the API server docker image
docker build -t sysml.api -f Dockerfile.api --build-arg RELEASE=$(release) .
.PHONY: build-jupyter
build-jupyter: ## build the API+Jupyter Jupyter docker image
docker build -t sysml.jupyter -f Dockerfile.jupyter --build-arg RELEASE=$(release) .
.PHONY: create-periphery
create-periphery: ## Create network and volume for docker-compose
-docker network create thenetwork
docker volume create postgresdbserver
.PHONY: spin-up
spin-up: create-periphery build-jupyter build-api ## spin all servers up
docker-compose -f docker-compose.yml up
##
## MyBinder image
##
.PHONY: build-mybinder
build-mybinder: ## build mybinder Jupyter image
docker build -t sysml.mybinder:$(release) -f Dockerfile --build-arg RELEASE=$(release) .
.PHONY: run-mybinder
run-mybinder: build-mybinder # run the mybinder jupyter image
docker run -p 8888:8888 -t sysml.mybinder:$(release) jupyter lab --ip 0.0.0.0 --port 8888
##
## Dockerhub image
##
.PHONY: build-hub
build-hub: ## Build dockerhub image
docker build -t gorenje/sysmlv2-jupyter:$(release) -f Dockerfile.hub --build-arg RELEASE=$(release) .
.PHONY: run-hub
run-hub: build-hub ## Run dockerhub image
docker run -p 8888:8888 -t gorenje/sysmlv2-jupyter:$(release)
## Build all
.PHONY: build
build: build-api build-hub build-standalone build-jupyter ## build all images
echo done
.PHONY: get-notebooks
get-notebooks: ## retrieve all notebooks in a standalone running container
docker exec -i $$(docker ps | grep sysml.standalone | awk '// { print $$1 }') /bin/bash -c "tar czf - notebooks/*.ipynb" | tar xf -
.PHONY: help
help:
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
.DEFAULT_GOAL := help