Skip to content

Commit edb309c

Browse files
fix: Update GPU base image dependencies and improve package installation in Dockerfile
1 parent 6730078 commit edb309c

File tree

1 file changed

+17
-9
lines changed

1 file changed

+17
-9
lines changed

Dockerfile.pb

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -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) =======================
2222
FROM nvidia/cuda:${CUDA_TAG} AS gpu-base
2323
ENV DEBIAN_FRONTEND=noninteractive
24-
ARG PY_VER
2524
RUN 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) ======================================
3232
FROM ${BUILD_TYPE}-base AS builder
3333
ENV DEBIAN_FRONTEND=noninteractive
3434
ARG TF_VER
3535
ARG BUILD_TYPE
3636

3737
COPY 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)
3948
RUN --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)
4755
COPY solaris /tmp/solaris
4856
RUN --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
5260
RUN --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)
5664
COPY setup.py README.md /tmp/ramp-code/
5765
COPY ramp /tmp/ramp-code/ramp
5866
RUN --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 ==============================================
6371
FROM ${BUILD_TYPE}-base AS final
6472
ENV DEBIAN_FRONTEND=noninteractive
6573

0 commit comments

Comments
 (0)