|
1 | | -######################################################################## |
2 | | -# Pynamical Dockerfile |
3 | | -# License: MIT, see full license in LICENSE.txt |
4 | | -# Web: https://github.com/gboeing/pynamical |
5 | | -# |
6 | | -# Build an image from the dockerfile: |
7 | | -# >>> docker build -t gboeing/pynamical . |
8 | | -# |
9 | | -# Push the built image to hub so others can pull/run it: |
10 | | -# >>> docker login |
11 | | -# >>> docker tag gboeing/pynamical gboeing/pynamical:v0.0.0 |
12 | | -# >>> docker push -a gboeing/pynamical |
13 | | -# |
14 | | -# Run bash in this container and export final conda environment to a yml file: |
15 | | -# >>> docker run --rm -it -u 0 --name pynamical -v %cd%:/home/jovyan/work gboeing/pynamical /bin/bash |
16 | | -# >>> conda env export -n base > /home/jovyan/work/environment.yml |
17 | | -# |
18 | | -# Run jupyter lab in this container: |
19 | | -# >>> docker run --rm -it --name pynamical -p 8888:8888 -v %cd%:/home/jovyan/work gboeing/pynamical |
20 | | -# >>> docker run --rm -it --name pynamical -p 8888:8888 -v $PWD:/home/jovyan/work gboeing/pynamical |
21 | | -# |
22 | | -# Stop/delete all local docker containers/images: |
23 | | -# >>> docker stop $(docker ps -aq) |
24 | | -# >>> docker rm $(docker ps -aq) |
25 | | -# >>> docker rmi $(docker images -q) |
26 | | -######################################################################## |
27 | | - |
28 | 1 | FROM jupyter/base-notebook |
29 | 2 | LABEL maintainer="Geoff Boeing <boeing@usc.edu>" |
30 | 3 | LABEL url="https://github.com/gboeing/pynamical" |
31 | 4 | LABEL description="Pynamical is a Python package for modeling, simulating, visualizing, and animating discrete nonlinear dynamical systems and chaos." |
32 | 5 |
|
33 | | -COPY requirements.txt /tmp/ |
| 6 | +COPY --chmod=0755 requirements.txt /tmp/ |
34 | 7 |
|
35 | | -# configure conda and install packages in one RUN to keep image tidy |
36 | | -RUN conda config --set show_channel_urls true && \ |
37 | | - conda config --set channel_priority strict && \ |
38 | | - conda config --prepend channels conda-forge && \ |
39 | | - conda update --yes -n base conda && \ |
40 | | - conda install --update-all --force-reinstall --yes --file /tmp/requirements.txt && \ |
41 | | - rm -f -r -v /opt/conda/share/jupyter/kernels/python3 && \ |
| 8 | +# install and configuration everything in one RUN to keep image tidy |
| 9 | +RUN conda update --yes -c conda-forge --strict-channel-priority -n base conda mamba && \ |
| 10 | + mamba install --update-all --force-reinstall --yes -c conda-forge --strict-channel-priority --file /tmp/requirements.txt && \ |
42 | 11 | python -m ipykernel install --sys-prefix --name pynamical --display-name "Python (pynamical)" && \ |
43 | | - conda clean --all --yes && \ |
| 12 | + rm -f -r -v /opt/conda/share/jupyter/kernels/python3 && \ |
| 13 | + conda clean --all --yes --quiet && \ |
44 | 14 | conda info --all && \ |
45 | 15 | conda list && \ |
46 | 16 | jupyter kernelspec list && \ |
|
0 commit comments