@@ -18,48 +18,56 @@ RUN apt-get update && \
1818 && rm -rf /var/lib/apt/lists/*
1919
2020# ==============================================================================
21- # === GPU base image (CUDA + custom Python install) ==== =======================
21+ # === GPU base image (CUDA + runtime-only Python & GDAL) =======================
2222FROM nvidia/cuda:${CUDA_TAG} AS gpu-base
2323ENV DEBIAN_FRONTEND=noninteractive
24- ARG PY_VER
2524RUN apt-get update && \
2625 apt-get install -y --no-install-recommends \
27- build-essential gcc g++ python3-dev python3-rtree \
26+ python3 python3-pip build-essential gcc g++ python3-dev python3-rtree \
2827 gdal-bin libgdal-dev python3-gdal python3-opencv libspatialindex-dev \
2928 && rm -rf /var/lib/apt/lists/*
29+
3030# ==============================================================================
31- # === Builder stage (installs everything) =====================================
31+ # === Builder stage (installs everything) ======================================
3232FROM ${BUILD_TYPE}-base AS builder
3333ENV DEBIAN_FRONTEND=noninteractive
3434ARG TF_VER
3535ARG BUILD_TYPE
3636
3737COPY docker/pipped-requirements.txt /tmp/pipped-requirements.txt
3838
39+ # # On GPU, install build & dev dependencies so we can compile GDAL
40+ # RUN if [ "$BUILD_TYPE" = "gpu" ]; then \
41+ # apt-get update && apt-get install -y --no-install-recommends \
42+ # build-essential gcc g++ python3-dev python3-rtree \
43+ # libgdal-dev swig libspatialindex-dev libpq-dev && \
44+ # rm -rf /var/lib/apt/lists/*; \
45+ # fi
46+
47+ # Use pip cache and install Python packages (including building GDAL)
3948RUN --mount=type=cache,target=/root/.cache/pip \
4049 pip install --no-cache-dir --upgrade pip more-itertools && \
4150 pip install --no-cache-dir tensorflow==${TF_VER} && \
4251 pip install "GDAL==$(gdal-config --version)" && \
4352 pip install --no-cache-dir -r /tmp/pipped-requirements.txt
4453
45-
4654# Install solaris (local)
4755COPY solaris /tmp/solaris
4856RUN --mount=type=cache,target=/root/.cache/pip \
49- pip install --no-cache-dir /tmp/solaris
57+ pip install --no-cache-dir /tmp/solaris
5058
5159# Install scikit-fmm
5260RUN --mount=type=cache,target=/root/.cache/pip \
53- pip install --no-cache-dir scikit-fmm
61+ pip install --no-cache-dir scikit-fmm
5462
5563# Install ramp (local)
5664COPY setup.py README.md /tmp/ramp-code/
5765COPY ramp /tmp/ramp-code/ramp
5866RUN --mount=type=cache,target=/root/.cache/pip \
59- pip install --no-cache-dir /tmp/ramp-code
67+ pip install --no-cache-dir /tmp/ramp-code
6068
6169# ==============================================================================
62- # === Final minimal runtime image =============================================
70+ # === Final minimal runtime image ==============================================
6371FROM ${BUILD_TYPE}-base AS final
6472ENV DEBIAN_FRONTEND=noninteractive
6573
0 commit comments