Skip to content

Commit

Permalink
add docker
Browse files Browse the repository at this point in the history
  • Loading branch information
gboeing committed Mar 6, 2019
1 parent 7ee0fce commit 501b206
Show file tree
Hide file tree
Showing 5 changed files with 205 additions and 0 deletions.
52 changes: 52 additions & 0 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
########################################################################
# Pynamical Dockerfile
# License: MIT, see full license in LICENSE.txt
# Web: https://github.com/gboeing/pynamical
#
# Build an image from the dockerfile:
# >>> docker build -t gboeing/pynamical .
#
# Push the built image to hub so others can pull/run it:
# >>> docker tag gboeing/pynamical gboeing/pynamical:v0.0.0
# >>> docker login
# >>> docker push gboeing/pynamical
#
# Run bash in this container and export final conda environment to a yml file:
# >>> docker run --rm -it -u 0 --name pynamical -v %cd%:/home/jovyan/work gboeing/pynamical /bin/bash
# >>> conda env export -n base > /home/jovyan/work/environment.yml
#
# Run jupyter lab in this container:
# >>> docker run --rm -it --name pynamical -p 8888:8888 -v %cd%:/home/jovyan/work gboeing/pynamical
#
# Stop/delete all local docker containers/images:
# >>> docker stop $(docker ps -aq)
# >>> docker rm $(docker ps -aq)
# >>> docker rmi $(docker images -q)
########################################################################

FROM jupyter/base-notebook
LABEL maintainer="Geoff Boeing <g.boeing@northeastern.edu>"

# symlink and permissions
USER root
RUN ln -s /opt/conda/bin/jupyter /usr/local/bin
USER $NB_UID

# configure conda and install packages in one RUN to keep image tidy
RUN conda config --set show_channel_urls true && \
conda config --prepend channels conda-forge && \
conda update --override-channels -c conda-forge --yes -n base conda && \
conda update --override-channels -c conda-forge --yes --all && \
conda install --override-channels -c conda-forge --yes pynamical && \
conda clean --yes --all && \
conda info --all && \
conda list

# launch notebook in the local working directory that we mount
WORKDIR /home/jovyan/work

# set default command to launch when container is run
CMD ["jupyter", "lab", "--no-browser", "--NotebookApp.token=''", "--NotebookApp.password=''"]

# to test, import pynamical and print its version
RUN python -c "import pynamical; print(pynamical.__version__)"
5 changes: 5 additions & 0 deletions docker/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Pynamical Docker Image

First, install [docker](https://www.docker.com/).

The pynamical docker container image and usage instructions are available on [docker hub](https://hub.docker.com/r/gboeing/pynamical).
8 changes: 8 additions & 0 deletions docker/windows-env/create-windows-environment.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
CALL conda update conda -n base --yes
CALL conda deactivate
CALL conda env remove -n pyn --yes
CALL conda create -n pyn -c conda-forge --strict-channel-priority --file "../../requirements.txt" --file "../../requirements-dev.txt" --file "requirements-more.txt" --yes
CALL conda activate pyn
CALL python -m ipykernel install --user
CALL conda clean --all --yes
CALL conda env export > environment-windows.yml
131 changes: 131 additions & 0 deletions docker/windows-env/environment-windows.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
name: pyn
channels:
- conda-forge
- defaults
dependencies:
- alabaster=0.7.12=py_0
- asn1crypto=0.24.0=py36_1003
- atomicwrites=1.3.0=py_0
- attrs=19.1.0=py_0
- babel=2.6.0=py_1
- backcall=0.1.0=py_0
- blas=1.1=openblas
- bleach=3.1.0=py_0
- bottleneck=1.2.1=py36h452e1ab_1001
- ca-certificates=2018.11.29=ha4d7672_0
- certifi=2018.11.29=py36_1000
- cffi=1.12.2=py36hfa6e2cd_0
- chardet=3.0.4=py36_1003
- colorama=0.4.1=py_0
- coverage=4.5.2=py36hfa6e2cd_1001
- coveralls=1.5.1=py_0
- cryptography=2.5=py36h74b6da3_1
- cycler=0.10.0=py_1
- cython=0.29.6=py36h6538335_0
- decorator=4.3.2=py_0
- defusedxml=0.5.0=py_1
- docopt=0.6.2=py_1
- docutils=0.14=py36_1001
- entrypoints=0.3=py36_1000
- freetype=2.9.1=h5db478b_1005
- icu=58.2=vc14_0
- idna=2.8=py36_1000
- imagesize=1.1.0=py_0
- ipykernel=5.1.0=py36h39e3cac_1002
- ipython=7.3.0=py36h39e3cac_0
- ipython_genutils=0.2.0=py_1
- jedi=0.13.3=py36_0
- jinja2=2.10=py_1
- jpeg=9c=hfa6e2cd_1001
- jsonschema=3.0.1=py36_0
- jupyter_client=5.2.4=py_3
- jupyter_core=4.4.0=py_0
- jupyterlab=0.35.4=py36_0
- jupyterlab_server=0.2.0=py_0
- kiwisolver=1.0.1=py36he980bc4_1002
- libflang=5.0.0=h6538335_20180525
- libpng=1.6.36=h7602738_1000
- libsodium=1.0.16=h2fa13f4_1001
- libtiff=4.0.10=h016b793_1002
- llvm-meta=5.0.0=0
- llvmlite=0.24.0=py36_1
- m2w64-gcc-libgfortran=5.3.0=6
- m2w64-gcc-libs=5.3.0=7
- m2w64-gcc-libs-core=5.3.0=7
- m2w64-gmp=6.1.0=2
- m2w64-libwinpthread-git=5.0.0.4634.697f757=2
- markupsafe=1.1.1=py36hfa6e2cd_0
- matplotlib=3.0.3=py36_0
- matplotlib-base=3.0.3=py36h3e3dc42_0
- mistune=0.8.4=py36hfa6e2cd_1000
- more-itertools=4.3.0=py36_1000
- msys2-conda-epoch=20160418=1
- nbconvert=5.4.1=py_2
- nbformat=4.4.0=py_1
- nodejs=11.10.0=0
- notebook=5.7.5=py36_0
- numba=0.39.0=py36h830ac7b_0
- numexpr=2.6.9=py36h6538335_1000
- numpy=1.16.2=py36_blas_openblash442142e_0
- olefile=0.46=py_0
- openblas=0.3.3=h535eed3_1001
- openmp=5.0.0=vc14_1
- openssl=1.0.2r=hfa6e2cd_0
- packaging=19.0=py_0
- pandas=0.24.1=py36h6538335_0
- pandoc=2.6=1
- pandocfilters=1.4.2=py_1
- parso=0.3.4=py_0
- pickleshare=0.7.5=py36_1000
- pillow=5.4.1=py36h9a613e6_1000
- pip=19.0.3=py36_0
- pluggy=0.9.0=py_0
- prometheus_client=0.6.0=py_0
- prompt_toolkit=2.0.9=py_0
- py=1.8.0=py_0
- pycparser=2.19=py_0
- pygments=2.3.1=py_0
- pynamical=0.2.1=py_0
- pyopenssl=19.0.0=py36_0
- pyparsing=2.3.1=py_0
- pyqt=5.6.0=py36h764d66f_1008
- pyrsistent=0.14.11=py36hfa6e2cd_0
- pysocks=1.6.8=py36_1002
- pytest=4.3.0=py36_0
- python=3.6.7=he025d50_1004
- python-dateutil=2.8.0=py_0
- pytz=2018.9=py_0
- pywinpty=0.5.5=py36_1000
- pyyaml=3.13=py36hfa6e2cd_1001
- pyzmq=18.0.1=py36he418aac_0
- qt=5.6.2=h2639256_8
- requests=2.21.0=py36_1000
- send2trash=1.5.0=py_0
- setuptools=40.8.0=py36_0
- sip=4.18.1=py36h6538335_1000
- six=1.12.0=py36_1000
- snowballstemmer=1.2.1=py_1
- sphinx=1.8.4=py36_0
- sphinxcontrib-websupport=1.1.0=py_1
- sqlite=3.26.0=hfa6e2cd_1000
- terminado=0.8.1=py36_1001
- testpath=0.4.2=py36_1000
- tk=8.6.9=hfa6e2cd_1000
- tornado=6.0.1=py36hfa6e2cd_0
- traitlets=4.3.2=py36_1000
- urllib3=1.24.1=py36_1000
- vc=14=0
- vs2015_runtime=14.0.25420=0
- wcwidth=0.1.7=py_1
- webencodings=0.5.1=py_1
- wheel=0.33.1=py36_0
- win_inet_pton=1.1.0=py36_0
- wincertstore=0.2=py36_1002
- winpty=0.4.3=4
- xz=5.2.4=h2fa13f4_1001
- yaml=0.1.7=hfa6e2cd_1001
- zeromq=4.2.5=he025d50_1006
- zlib=1.2.11=h2fa13f4_1004
- zstd=1.3.3=vc14_1
prefix: C:\Anaconda\envs\pyn

9 changes: 9 additions & 0 deletions docker/windows-env/requirements-more.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
bottleneck
cython
jupyterlab
nodejs
numexpr
pillow
pip
pynamical
python == 3.*

0 comments on commit 501b206

Please sign in to comment.