Skip to content

Commit

Permalink
fix: rework Dockerfile for Debian 12
Browse files Browse the repository at this point in the history
  • Loading branch information
paulschreiber committed May 13, 2024
1 parent 34acc7c commit 2611fde
Showing 1 changed file with 9 additions and 17 deletions.
26 changes: 9 additions & 17 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,42 +1,34 @@
FROM ghcr.io/osgeo/gdal:ubuntu-full-latest
FROM python:3.12.3-slim-bookworm

RUN adduser --disabled-password terraso

ENV PATH /home/terraso/.local/bin:$PATH
# see https://github.com/aws/aws-cli/tags for list of versions
ENV AWS_CLI_VERSION 2.8.12

RUN apt-get update && \
apt-get install -q -y --no-install-recommends software-properties-common
# Add testing sources and pin the GDAL packages to testing
# Allows us to get 3.8.x versions of GDAL
RUN sed 's/bookworm/testing/g' /etc/apt/sources.list.d/debian.sources > /etc/apt/sources.list.d/testing.sources

# prevent tzdata from prompting
RUN ln -fs /usr/share/zoneinfo/America/New_York /etc/localtime
RUN echo 'Package: libgdal-dev gdal-bin\nPin: release a=testing\nPin-Priority: 900' > /etc/apt/preferences.d/gdal-testing

RUN apt-get update && \
apt-get install -q -y --no-install-recommends \
python3.12 python3.12-dev \
build-essential libpq-dev dnsutils libmagic-dev mailcap \
gettext \
libkml-dev unzip curl && \
gettext software-properties-common \
libkml-dev libgdal-dev gdal-bin unzip curl && \
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip" && \
unzip awscliv2.zip && \
./aws/install && \
apt-get clean && rm -rf /var/lib/apt/lists/*

RUN mkdir -p /root/.config/pip && echo "[global]" > /root/.config/pip/pip.conf && echo "break-system-packages = true" >> /root/.config/pip/pip.conf
RUN curl -s https://bootstrap.pypa.io/get-pip.py | python3.12

RUN adduser --disabled-password terraso

WORKDIR /app

COPY --chown=terraso:terraso requirements.txt /app
COPY --chown=terraso:terraso Makefile /app

USER terraso

RUN pip config set global.break-system-packages true

# there is no python3.12-pytest, so install manually
RUN pip install pytest
RUN pip install --upgrade pip && make install

COPY --chown=terraso:terraso . /app
Expand Down

0 comments on commit 2611fde

Please sign in to comment.