Skip to content

Commit 05d2860

Browse files
committed
Notebook Docker: avoid using anaconda defaults
1 parent dfe4ed3 commit 05d2860

File tree

2 files changed

+18
-5
lines changed

2 files changed

+18
-5
lines changed

.github/workflows/DockerBuild.NotebookImage.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ on:
1111
version:
1212
description: "Version of ArcGIS API for Python to install in the image"
1313
type: string
14-
default: "2.3.1"
14+
default: "2.4.1"
1515
python_version:
1616
description: "Python version to base image on"
1717
type: string

docker/NotebookImage.Dockerfile

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@ ARG python_version="3.11"
22
FROM quay.io/jupyter/minimal-notebook:python-${python_version}
33

44
ARG python_version
5-
ARG arcgis_version="2.4.0"
5+
ARG arcgis_version="2.4.1"
6+
ARG gdal_version="3.10.2"
67
ARG sampleslink="https://github.com/Esri/arcgis-python-api/releases/download/v${arcgis_version}/samples.zip"
78
ARG githubfolder="arcgis-python-api"
89
ARG env_name=arcgis
@@ -14,14 +15,26 @@ LABEL org.opencontainers.image.source=https://github.com/Esri/arcgis-python-api
1415

1516
USER ${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+
# Create conda environment with specified python version
19+
RUN conda create -n ${env_name} -c conda-forge python=${python_version} -y --quiet --override-channels \
20+
&& conda clean --all -f -y \
21+
&& find /opt/conda -name __pycache__ -type d -exec rm -rf {} +
22+
23+
# Install gdal
24+
RUN conda install -n ${env_name} -c conda-forge gdal=${gdal_version} -y --quiet --override-channels \
25+
&& conda clean --all -f -y \
26+
&& find /opt/conda -name __pycache__ -type d -exec rm -rf {} +
27+
28+
# Install ArcGIS API for Python from pypi
29+
RUN . activate ${env_name} \
30+
&& python -m pip install arcgis==${arcgis_version} \
1931
&& conda clean --all -f -y \
2032
&& find /opt/conda -name __pycache__ -type d -exec rm -rf {} +
2133

2234
# Install arcgis-mapping if arcgis_version >= 2.4.0
2335
RUN (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 \
36+
&& . activate ${env_name} \
37+
&& python -m pip install arcgis-mapping \
2538
&& conda clean --all -f -y \
2639
&& find /opt/conda -name __pycache__ -type d -exec rm -rf {} +;) \
2740
|| echo "[INFO] Skipped installing arcgis-mapping for version $arcgis_version (>= 2.4.0 required for arcgis-mapping)"

0 commit comments

Comments
 (0)