1+ ARG python_version="3.9"
2+ FROM jupyter/base-notebook:python-${python_version}
3+
4+ ARG python_version
5+ ARG arcgis_version="2.2.0"
6+ ARG sampleslink="https://github.com/Esri/arcgis-python-api/releases/download/v${arcgis_version}/samples.zip"
7+ ARG githubfolder="arcgis-python-api"
8+ ENV DOCKER_STACKS_JUPYTER_CMD="notebook"
9+
10+ LABEL org.opencontainers.image.authors="jroebuck@esri.com"
11+ LABEL org.opencontainers.image.description="Jupyter Notebook with the latest version of the ArcGIS API for Python and its Linux dependencies preinstalled"
12+ LABEL org.opencontainers.image.licenses=Apache
13+ LABEL org.opencontainers.image.source=https://github.com/Esri/arcgis-python-api
14+
15+ USER root
16+
17+ RUN apt-get update --yes && \
18+ apt-get install --yes --no-install-recommends unzip && \
19+ apt-get clean && rm -rf /var/lib/apt/lists/*
20+
21+ USER ${NB_UID}
22+
23+ # Install Python API from Conda
24+ RUN conda install -c esri arcgis=${arcgis_version} -y \
25+ && conda clean --all -f -y \
26+ && find /opt/conda -name __pycache__ -type d -exec rm -rf {} +
27+
28+ # Fetch and extract samples from GitHub
29+ RUN mkdir /home/${NB_USER}/$githubfolder && \
30+ wget -O samples.zip $sampleslink \
31+ && unzip -q samples.zip -d /home/${NB_USER}/$githubfolder \
32+ && rm samples.zip \
33+ && mv /home/${NB_USER}/$githubfolder/* ./ \
34+ && rm -rf $githubfolder/ \
35+ apidoc/ \
36+ work/ \
37+ talks/ \
38+ environment.yml\
39+ && fix-permissions /home/${NB_USER}
40+
41+ RUN rm /opt/conda/lib/python${python_version}/site-packages/notebook/static/base/images/logo.png
42+ COPY --chown=${NB_USER}:users jupyter_esri_logo.png /opt/conda/lib/python${python_version}/site-packages/notebook/static/base/images/logo.png
0 commit comments