1
0
mirror of https://github.com/balkian/phd-dockerenv.git synced 2024-11-21 11:02:30 +00:00
phd-dockerenv/Makefile

27 lines
818 B
Makefile
Raw Normal View History

2017-06-03 16:04:53 +00:00
PYVERSIONS=3.5 3.4 2.7
PYMAIN=$(firstword $(PYVERSIONS))
NAME=scipynb
REPO=balkian
VERSION=$(shell cat VERSION)
IMAGENAME=$(REPO)/$(NAME):$(VERSION)
ROOTDIR:=$(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
WDIR=$(ROOTDIR)/..
version:
date +%Y%m%d.%H%M > VERSION
build: VERSION
docker build --pull . -t $(IMAGENAME)
run:
docker run --rm -v $(WDIR)/.nbconfig:/home/jovyan/.jupyter/nbconfig -v $(WDIR)/:/home/jovyan/work/ -p 8888:8888 $(IMAGENAME)
clean:
@docker ps -a | awk '/$(REPO)\/$(NAME)/{ split($$2, vers, "-"); if(vers[1] != "${VERSION}"){ print $$1;}}' | xargs docker rm 2>/dev/null|| true
@docker images | awk '/$(REPO)\/$(NAME)/{ split($$2, vers, "-"); if(vers[1] != "${VERSION}"){ print $$1":"$$2;}}' | xargs docker rmi 2>/dev/null|| true
@docker rmi $(NAME)-debug 2>/dev/null || true