-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathgispy.dockerfile
87 lines (73 loc) · 3.49 KB
/
gispy.dockerfile
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
ARG BASE_IMAGE="jupyter/minimal-notebook:latest"
FROM $BASE_IMAGE
ENV BASE_IMAGE $BASE_IMAGE
# ARG JUPYTERHUB_VERSION="3.0.0"
# RUN python -m pip install --no-cache jupyterhub==$JUPYTERHUB_VERSION && \
# echo "jupyterhub $(jupyterhub --version)" >> $CONDA_DIR/conda-meta/pinned
# This lines above are necessary to guarantee a smooth coupling JupyterHub.
# -------------------------------------------------------------------------
ENV LANG=C.UTF-8 LC_ALL=C.UTF-8
# Guarantee some basic system tools are installed
#
USER root
RUN apt-get update -y && \
apt-get install -y --no-install-recommends \
bzip2 \
ca-certificates \
curl \
git \
libgl1-mesa-glx \
libjpeg9 \
libjpeg9-dev \
rsync \
wget \
vim && \
rm -rf /var/lib/apt/lists/* && \
apt-get autoremove
USER $NB_UID
# Set some global configs to Conda
#
RUN conda config --set always_yes true && \
conda config --set use_only_tar_bz2 false && \
conda config --set notify_outdated_conda false && \
#
## conda-update may not be necessary, and can mess up things.
## for instance, https://github.com/conda/conda/issues/10887,
## guarantee 'pip' will be there after updating.
# conda update conda && \
# conda install pip && \
#
## "nb-conda-kernels" doesn't seem to work (as I expected).
## There is a discussion about managing kernels/nb_conda_kernels
## in: https://github.com/jupyter-server/jupyter_server/pull/112.
## In short, nb_conda_kernels used to work well, but is outdated.
# conda install nb_conda_kernels && \
#
conda config --add create_default_packages ipykernel && \
conda config --add create_default_packages pip && \
conda config --add create_default_packages sh && \
conda clean -a
## Install the GIS packages listed in 'gispy.txt'
#
# Copy the list of packages to install ("requirements.txt")
COPY gispy.txt /tmp/gispy.txt
# Turn off PyGEOS, prefer Shapely (for some reason)
# - https://geopandas.org/en/stable/docs/user_guide/pygeos_to_shapely.html
ENV USE_PYGEOS=0
# Install gispy packages
RUN mamba install -y --file /tmp/gispy.txt && \
mamba clean -a
## Write a README file for user
#
ENV README=$HOME/README.md
COPY readmes/readme.base.md /tmp/readme.base.md
COPY readmes/readme.gispy.md /tmp/readme.gispy.md
RUN cat /tmp/readme.base.md | envsubst > $README && \
echo "" >> $README &&\
cat /tmp/readme.gispy.md | envsubst >> $README && \
echo "" >> $README &&\
echo "Python/Conda packages installed by *us*:" >> $README && \
conda env export --no-builds \
| grep --file /tmp/gispy.txt --word-regexp >> $README &&\
echo "" >> $README
# COPY etc/jupyterlab/user_settings.json /opt/conda/share/jupyter/lab/settings/overrides.json