Skip to content

Commit

Permalink
Dockerfile: update to GDAL 3.9.1
Browse files Browse the repository at this point in the history
Make the minimal change to mirror
the change from datacube-explorer's
update to GDAL 3.9.
  • Loading branch information
pjonsson committed Aug 7, 2024
1 parent a1ab57c commit 97e0448
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 15 deletions.
20 changes: 8 additions & 12 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,18 +1,16 @@
# Note that this is now pinned to a fixed version. Remember to check for new versions periodically.
FROM ghcr.io/osgeo/gdal:ubuntu-small-3.8.5 AS builder
FROM ghcr.io/osgeo/gdal:ubuntu-small-3.9.1 AS builder

# Setup build env for postgresql-client-14
# Setup build env for postgresql-client-16
USER root
RUN apt-get update -y \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --fix-missing --no-install-recommends \
git \
# For pybabel
python3-distutils \
# For Psycopg2
libpq-dev python3-dev \
gcc \
python3-pip \
postgresql-client-14 \
postgresql-client-16 \
# For Pyproj build \
proj-bin proj-data libproj-dev \
&& apt-get clean \
Expand All @@ -25,18 +23,18 @@ WORKDIR /code
COPY . /code

RUN echo "version=\"$(python3 setup.py --version)\"" > datacube_ows/_version.py \
&& pip install --no-cache-dir .[ops,test]
&& pip --disable-pip-version-check install --no-cache-dir .[ops,test] --break-system-packages

## Only install pydev requirements if arg PYDEV_DEBUG is set to 'yes'
ARG PYDEV_DEBUG="no"
RUN if [ "$PYDEV_DEBUG" = "yes" ]; then \
pip install --no-cache-dir .[dev] \
pip --disable-pip-version-check install --no-cache-dir .[dev] --break-system-packages \
;fi

RUN pip freeze

# Should match builder base.
FROM ghcr.io/osgeo/gdal:ubuntu-small-3.8.5
FROM ghcr.io/osgeo/gdal:ubuntu-small-3.9.1

RUN apt-get update -y \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
Expand All @@ -49,9 +47,8 @@ RUN apt-get update -y \
COPY --chown=root:root --link docker/files/remap-user.sh /usr/local/bin/remap-user.sh

# all the python pip installed libraries
COPY --from=builder /usr/local/lib/python3.10/dist-packages /usr/local/lib/python3.10/dist-packages
COPY --from=builder /usr/local/lib/python3.12/dist-packages /usr/local/lib/python3.12/dist-packages
COPY --from=builder /usr/lib/python3/dist-packages /usr/lib/python3/dist-packages
COPY --from=builder /usr/lib/python3.10/distutils/* /usr/lib/python3.10/distutils/
# postgres client
COPY --from=builder /usr/lib/postgresql /usr/lib/postgresql
COPY --from=builder /usr/share/postgresql /usr/share/postgresql
Expand All @@ -78,8 +75,7 @@ WORKDIR /code
COPY . /code

# Configure user
RUN useradd -m -s /bin/bash ows
WORKDIR "/home/ows"
WORKDIR "/home/ubuntu"

ENV GDAL_DISABLE_READDIR_ON_OPEN="EMPTY_DIR" \
CPL_VSIL_CURL_ALLOWED_EXTENSIONS=".tif, .tiff" \
Expand Down
6 changes: 3 additions & 3 deletions docker/files/remap-user.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
USER_ID=${LOCAL_UID:-1000}
GROUP_ID=${LOCAL_GID:-1000}

[[ "$USER_ID" == "1000" ]] || usermod -u $USER_ID -o -m -d /home/ows ows
[[ "$GROUP_ID" == "1000" ]] || groupmod -g $GROUP_ID ows
[[ $(id -u) != "0" ]] || GOSU="/usr/sbin/gosu ows"
[[ "$USER_ID" == "1000" ]] || usermod -u $USER_ID -o -m -d /home/ubuntu ubuntu
[[ "$GROUP_ID" == "1000" ]] || groupmod -g $GROUP_ID ubuntu
[[ $(id -u) != "0" ]] || GOSU="/usr/sbin/gosu ubuntu"
exec /usr/bin/tini -- $GOSU "$@"

0 comments on commit 97e0448

Please sign in to comment.