diff --git a/.github/workflows/build-docker.yml b/.github/workflows/build-docker.yml index f66273f..4a0fbb3 100644 --- a/.github/workflows/build-docker.yml +++ b/.github/workflows/build-docker.yml @@ -31,14 +31,13 @@ jobs: type=raw,value=latest,enable=${{ github.event_name == 'push' || github.event_name == 'workflow_dispatch' || github.event_name == 'schedule' }} type=raw,value={{date 'YYYY-MM-DD'}},enable=${{ github.event_name == 'schedule' }} - - name: Set up QEMU - uses: docker/setup-qemu-action@v3 - - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 + with: + driver-opts: network=host - name: Login to GitHub Container Registry - if: github.event_name != 'pull_request' + if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository uses: docker/login-action@v3 with: registry: ghcr.io diff --git a/python/Dockerfile b/python/Dockerfile index 844edbf..b2bf169 100644 --- a/python/Dockerfile +++ b/python/Dockerfile @@ -1,10 +1,13 @@ -ARG PYTHON_BASE_IMAGE=python:3.12-slim-trixie +ARG PYTHON_BASE_IMAGE=python:3.14-slim-trixie FROM ${PYTHON_BASE_IMAGE} ARG QUARTO_VERSION=1.11.9 LABEL devcontainer.metadata='[{"customizations":{"vscode":{"extensions":["quarto.quarto","ms-python.python","ms-toolsai.jupyter"],"settings":{"python.defaultInterpreterPath":"/usr/local/bin/python"}}}}]' +ENV QUARTO_PYTHON="/usr/local/bin/python" \ + RETICULATE_PYTHON="/usr/local/bin/python" + # Install dependencies, git, and gh cli RUN apt-get update && apt-get install -y --no-install-recommends \ ca-certificates \ @@ -32,7 +35,8 @@ RUN arch="$(dpkg --print-architecture)" \ COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /usr/local/bin/ # Install requirements using uv for fast parallel wheel resolution -RUN wget -q -O /tmp/requirements.txt https://raw.githubusercontent.com/geocompx/py/main/requirements.txt \ +RUN wget -q -O /tmp/requirements.txt https://raw.githubusercontent.com/geocompx/geocompy/main/requirements.txt \ + && sed -i 's/==/>=/g' /tmp/requirements.txt \ && uv pip install --system --no-cache -r /tmp/requirements.txt seaborn openpyxl statsmodels pyarrow \ && rm /tmp/requirements.txt diff --git a/pythonr/Dockerfile b/pythonr/Dockerfile index aeae8a2..08a8671 100644 --- a/pythonr/Dockerfile +++ b/pythonr/Dockerfile @@ -32,10 +32,9 @@ RUN . /etc/os-release && \ && ln -sfn /opt/R/current/bin/Rscript /usr/local/bin/Rscript \ && rm -rf /tmp/r.deb /var/lib/apt/lists/* -ENV PATH="/opt/R/current/bin:${PATH}" - -# Make Python visible on standard path for R's reticulate -RUN update-alternatives --install /usr/bin/python3 python3 /usr/local/bin/python 10 +ENV PATH="/opt/R/current/bin:/usr/local/bin:${PATH}" \ + QUARTO_PYTHON="/usr/local/bin/python" \ + RETICULATE_PYTHON="/usr/local/bin/python" # Configure Rprofile.site and /root/.Rprofile with P3M binary repository and HTTPUserAgent # so both pak and base install.packages() receive precompiled Linux binary packages from P3M @@ -62,4 +61,6 @@ RUN R -e "install.packages('pak')" # Install geocompkg (including Suggests) + VS Code R extension (vscode-R v3+) dependencies # using pak so system requirements and precompiled P3M/r-universe binaries are resolved in parallel RUN Rscript -e "options(repos = c(geocompx = 'https://geocompx.r-universe.dev', mlrorg = 'https://mlr-org.r-universe.dev', getOption('repos'))); pak::pak(c('sf', 'geocompkg', 'languageserver', 'httpgd', 'jgd', 'rstudioapi', 'processx', 'ps', 'later', 'jsonlite', 'svglite', 'reticulate'), dependencies = TRUE)" && \ - rm -rf /tmp/* /root/.cache/R/pkgcache + ln -sf /usr/local/bin/python /usr/bin/python3 && \ + ln -sf /usr/local/bin/python /usr/bin/python && \ + rm -rf /tmp/* /root/.cache/R/pkgcache /var/lib/apt/lists/* diff --git a/rocker-rpy/Dockerfile b/rocker-rpy/Dockerfile index 63fa706..60765c3 100644 --- a/rocker-rpy/Dockerfile +++ b/rocker-rpy/Dockerfile @@ -33,4 +33,7 @@ ENV QUARTO_PYTHON=/usr/bin/python # The `--break-system-packages` flag is added to override the security feature. # The `--ignore-installed` flag is added to prevent pip from trying to uninstall # packages that are managed by the system. -RUN pip3 install --no-cache-dir --break-system-packages --ignore-installed -r https://github.com/geocompx/geocompy/raw/refs/heads/main/requirements.txt +RUN wget -q -O /tmp/requirements.txt https://github.com/geocompx/geocompy/raw/refs/heads/main/requirements.txt \ + && sed -i 's/==/>=/g' /tmp/requirements.txt \ + && pip3 install --no-cache-dir --break-system-packages --ignore-installed -r /tmp/requirements.txt \ + && rm /tmp/requirements.txt