@@ -2,7 +2,8 @@ ARG python_version="3.11"
22FROM quay.io/jupyter/minimal-notebook:python-${python_version}
33
44ARG python_version
5- ARG arcgis_version="2.4.0"
5+ ARG arcgis_version="2.4.1"
6+ ARG gdal_version="3.10.2"
67ARG sampleslink="https://github.com/Esri/arcgis-python-api/releases/download/v${arcgis_version}/samples.zip"
78ARG githubfolder="arcgis-python-api"
89ARG env_name=arcgis
@@ -14,14 +15,29 @@ LABEL org.opencontainers.image.source=https://github.com/Esri/arcgis-python-api
1415
1516USER ${NB_UID}
1617
17- # Install Python API from Conda
18- RUN conda create -n ${env_name} -c esri -c defaults arcgis=${arcgis_version} python=${python_version} -y --quiet --override-channels \
18+ # change RUN shell to bash with .bashrc loaded
19+ SHELL ["/bin/bash" , "-l" , "-c" ]
20+
21+ # Create conda environment with specified python version
22+ RUN conda create -n ${env_name} -c conda-forge python=${python_version} -y --quiet --override-channels \
23+ && conda clean --all -f -y \
24+ && find /opt/conda -name __pycache__ -type d -exec rm -rf {} +
25+
26+ # Install gdal
27+ RUN conda install -n ${env_name} -c conda-forge gdal=${gdal_version} -y --quiet --override-channels \
28+ && conda clean --all -f -y \
29+ && find /opt/conda -name __pycache__ -type d -exec rm -rf {} +
30+
31+ # Install ArcGIS API for Python from pypi
32+ RUN conda activate ${env_name} \
33+ && python -m pip install arcgis==${arcgis_version} \
1934 && conda clean --all -f -y \
2035 && find /opt/conda -name __pycache__ -type d -exec rm -rf {} +
2136
2237# Install arcgis-mapping if arcgis_version >= 2.4.0
2338RUN (dpkg --compare-versions $arcgis_version ge 2.4.0 \
24- && conda install -n ${env_name} -c esri -c defaults arcgis-mapping -y --quiet --override-channels \
39+ && conda activate ${env_name} \
40+ && python -m pip install arcgis-mapping \
2541 && conda clean --all -f -y \
2642 && find /opt/conda -name __pycache__ -type d -exec rm -rf {} +;) \
2743 || echo "[INFO] Skipped installing arcgis-mapping for version $arcgis_version (>= 2.4.0 required for arcgis-mapping)"
0 commit comments