1
0
mirror of https://github.com/balkian/phd-dockerenv.git synced 2024-11-26 21:42:31 +00:00

First commit

This commit is contained in:
J. Fernando Sánchez 2017-06-03 18:04:53 +02:00
commit f04f21c7ec
3 changed files with 51 additions and 0 deletions

24
Dockerfile Normal file
View File

@ -0,0 +1,24 @@
FROM jupyter/scipy-notebook
MAINTAINER J. Fernando Sánchez <j@sinpapel.es>
RUN conda config --set always_yes yes --set changeps1 no
RUN conda config \
--add channels ostrokach \
--add channels defaults \
--add channels conda-forge
RUN conda install -c ostrokach graph-tool=2.22
RUN pip install jupyter_contrib_nbextensions
RUN pip install jupyter_nbextensions_configurator
RUN jupyter nbextensions_configurator enable --user
RUN jupyter contrib nbextension install --user
RUN mkdir -p $(jupyter --data-dir)/nbextensions
RUN git clone https://github.com/lambdalisue/jupyter-vim-binding $(jupyter --data-dir)/nbextensions/vim_binding
RUN chmod -R go-w $(jupyter --data-dir)/nbextensions/vim_binding
RUN jupyter nbextension enable --user vim_binding/vim_binding

26
Makefile Normal file
View File

@ -0,0 +1,26 @@
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

1
VERSION Normal file
View File

@ -0,0 +1 @@
20170504.1959