Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,6 @@
"image": "ghcr.io/geocompx/minimal:latest",
"customizations": {
"vscode": {
"settings": {
"r.rterm.linux": "/usr/local/bin/arf",
"r.rterm.option": [],
"r.bracketedPaste": true
},
"extensions": [
"REditorSupport.r",
"quarto.quarto",
Expand Down
7 changes: 3 additions & 4 deletions .github/workflows/build-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,20 +38,19 @@ jobs:
uses: docker/setup-buildx-action@v3

- name: Login to GitHub Container Registry
if: github.event_name == 'schedule' || github.event_name == 'push' || github.event_name == 'workflow_dispatch'
if: github.event_name != 'pull_request'
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push
if: github.event_name == 'schedule' || github.event_name == 'push' || github.event_name == 'workflow_dispatch'
- name: Build and push (push skipped on pull_request)
uses: docker/build-push-action@v6
with:
context: .
file: ${{ inputs.dockerfile }}
push: true
push: ${{ github.event_name != 'pull_request' }}
Comment on lines 52 to +53

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated the step name to "Build and push (push skipped on pull_request)" to make it clear that push is conditional and disabled on pull_request events.

tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
secrets: |
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ on:
branches:
- 'master'
- 'main'
pull_request:
branches:
- 'master'
- 'main'
workflow_dispatch: # Allows manual triggering

jobs:
Expand Down
6 changes: 1 addition & 5 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,7 @@ If not, see documentation on using Docker at websites such as [docker.com](https

## Devcontainers and VS Code support

The R-enabled images in this repository (`latest`, `minimal`, `osgeo`, `pythonr`) fully support VS Code Devcontainers. When you launch a devcontainer using one of these images:

* **Alternative R Frontend (arf)** is pre-installed system-wide to `/usr/local/bin/arf`, providing a highly improved interactive R shell with bracketed paste, multi-line editing, and syntax highlighting.
* VS Code is automatically configured via container metadata to use `arf` as the default R terminal frontend out-of-the-box.
* For interactive convenience, the `R` command is aliased system-wide (`alias R=arf`) in bash terminals. Typing `R` in an interactive shell automatically routes to the `arf` console. (This is safe as shell aliases only apply in interactive bash shells and do not interfere with standard non-interactive scripts running package installations or build pipelines).
The R-enabled images in this repository (`latest`, `minimal`, `osgeo`, `pythonr`) fully support VS Code Devcontainers.

## Sharing folders with Docker

Expand Down
15 changes: 1 addition & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,20 +55,7 @@ If not, see documentation on using Docker at websites such as
## Devcontainers and VS Code support

The R-enabled images in this repository (`latest`, `minimal`, `osgeo`,
`pythonr`) fully support VS Code Devcontainers. When you launch a
devcontainer using one of these images:

- **Alternative R Frontend (arf)** is pre-installed system-wide to
`/usr/local/bin/arf`, providing a highly improved interactive R shell
with bracketed paste, multi-line editing, and syntax highlighting.
- VS Code is automatically configured via container metadata to use
`arf` as the default R terminal frontend out-of-the-box.
- For interactive convenience, the `R` command is aliased system-wide
(`alias R=arf`) in bash terminals. Typing `R` in an interactive shell
automatically routes to the `arf` console. (This is safe as shell
aliases only apply in interactive bash shells and do not interfere
with standard non-interactive scripts running package installations or
build pipelines).
`pythonr`) fully support VS Code Devcontainers.

## Sharing folders with Docker

Expand Down
2 changes: 0 additions & 2 deletions dockerfiles/archive/binder/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
FROM rocker/binder
USER root
RUN R -e "install.packages('geocompkg', upgrade = TRUE, dependencies = TRUE, force = TRUE, repos = c('https://geocompr.r-universe.dev', 'https://mlr-org.r-universe.dev', 'https://cloud.r-project.org'))"
# Install arf — Alternative R Frontend (https://github.com/eitsupi/arf)
RUN curl --proto '=https' --tlsv1.2 -LsSf https://github.com/eitsupi/arf/releases/latest/download/arf-console-installer.sh | sh
USER $NB_USER
2 changes: 0 additions & 2 deletions dockerfiles/archive/geocompy/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
FROM glcr.b-data.ch/r/geospatial
RUN R -e "if (!requireNamespace('pak', quietly = TRUE)) install.packages('pak', repos = 'https://cloud.r-project.org/'); pak::pak('geocompx/geocompkg', upgrade = TRUE)"
# Install arf — Alternative R Frontend (https://github.com/eitsupi/arf)
RUN curl --proto '=https' --tlsv1.2 -LsSf https://github.com/eitsupi/arf/releases/latest/download/arf-console-installer.sh | sh
9 changes: 1 addition & 8 deletions minimal/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,9 @@ ARG QUARTO_VERSION=1.9.37

# Ship editor defaults with the image so downstream Codespaces/devcontainers
# inherit Quarto support even when they only reference the published image.
LABEL devcontainer.metadata='[{"customizations":{"vscode":{"settings":{"r.rterm.linux":"/usr/local/bin/arf","r.bracketedPaste":true},"extensions":["quarto.quarto","REditorSupport.r","ms-python.python","ms-toolsai.jupyter"]}}}]'
LABEL devcontainer.metadata='[{"customizations":{"vscode":{"extensions":["quarto.quarto","REditorSupport.r","ms-python.python","ms-toolsai.jupyter"]}}}]'

RUN R -e "if (!requireNamespace('pak', quietly = TRUE)) install.packages('pak', repos = 'https://cloud.r-project.org/'); pak::pak('geocompx/geocompkg', upgrade = TRUE)"
# Install arf — Alternative R Frontend (https://github.com/eitsupi/arf)
RUN export ARF_CONSOLE_INSTALL_DIR=/usr/local ARF_CONSOLE_NO_MODIFY_PATH=1 \
&& wget -qO /tmp/arf-installer.sh https://github.com/eitsupi/arf/releases/download/v0.3.4/arf-console-installer.sh \
&& sh /tmp/arf-installer.sh \
&& rm /tmp/arf-installer.sh
# Update quarto to latest stable version:
RUN /rocker_scripts/install_quarto.sh ${QUARTO_VERSION}
# Set RStudio preferences
Expand All @@ -21,5 +16,3 @@ RUN echo '{' >> /etc/rstudio/rstudio-prefs.json
RUN echo ' "rmd_chunk_output_inline": false' >> /etc/rstudio/rstudio-prefs.json
RUN echo '}' >> /etc/rstudio/rstudio-prefs.json

# System-wide shell alias to make 'R' run 'arf' in interactive shells
RUN echo "alias R=arf" >> /etc/bash.bashrc
11 changes: 0 additions & 11 deletions osgeo/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,20 +1,9 @@
FROM rocker/geospatial:dev-osgeo
RUN R -e "if (!requireNamespace('pak', quietly = TRUE)) install.packages('pak', repos = 'https://cloud.r-project.org/'); pak::pak('geocompx/geocompkg', upgrade = TRUE)"
# Install arf — Alternative R Frontend (https://github.com/eitsupi/arf)
RUN export ARF_CONSOLE_INSTALL_DIR=/usr/local ARF_CONSOLE_NO_MODIFY_PATH=1 \
&& wget -qO /tmp/arf-installer.sh https://github.com/eitsupi/arf/releases/download/v0.3.4/arf-console-installer.sh \
&& sh /tmp/arf-installer.sh \
&& rm /tmp/arf-installer.sh

# Ship editor defaults with the image so downstream Codespaces/devcontainers
# inherit VS Code R support even when they only reference the published image.
LABEL devcontainer.metadata='[{"customizations":{"vscode":{"settings":{"r.rterm.linux":"/usr/local/bin/arf","r.bracketedPaste":true},"extensions":["quarto.quarto","REditorSupport.r","ms-python.python","ms-toolsai.jupyter"]}}}]'

# Set RStudio preferences
# No inline code:
RUN echo '{' >> /etc/rstudio/rstudio-prefs.json
RUN echo ' "rmd_chunk_output_inline": false' >> /etc/rstudio/rstudio-prefs.json
RUN echo '}' >> /etc/rstudio/rstudio-prefs.json

# System-wide shell alias to make 'R' run 'arf' in interactive shells
RUN echo "alias R=arf" >> /etc/bash.bashrc
12 changes: 1 addition & 11 deletions pythonr/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
FROM ghcr.io/geocompx/python

LABEL devcontainer.metadata='[{"customizations":{"vscode":{"settings":{"r.rterm.linux":"/usr/local/bin/arf","r.bracketedPaste":true},"extensions":["quarto.quarto","REditorSupport.r","ms-python.python","ms-toolsai.jupyter"]}}}]'

# Note: previously this image built on Rocker but install_R_ppa.sh fails on Debian
RUN apt-get update && apt-get install -y --no-install-recommends \
curl \
locales \
xz-utils \
&& rm -rf /var/lib/apt/lists/*
# Manual R installation: Download and install R DEB for Debian 12
ARG R_VERSION=4.5.1
ARG R_VERSION=4.6.0
RUN curl -O https://cdn.posit.co/r/debian-12/pkgs/r-${R_VERSION}_1_$(dpkg --print-architecture).deb && \
apt-get update && \
apt-get install -y --no-install-recommends ./r-${R_VERSION}_1_$(dpkg --print-architecture).deb && \
Expand All @@ -19,12 +17,6 @@ ENV PATH="/opt/R/${R_VERSION}/bin:${PATH}"
ENV R_PKG_TYPE=binary
ENV RETICULATE_PYTHON="/usr/local/bin/python"

# Install arf — Alternative R Frontend (https://github.com/eitsupi/arf)
RUN export ARF_CONSOLE_INSTALL_DIR=/usr/local ARF_CONSOLE_NO_MODIFY_PATH=1 \
&& wget -qO /tmp/arf-installer.sh https://github.com/eitsupi/arf/releases/download/v0.3.4/arf-console-installer.sh \
&& sh /tmp/arf-installer.sh \
&& rm /tmp/arf-installer.sh

RUN mkdir -p /etc/R && \
echo "options(repos = c(CRAN = 'https://packagemanager.posit.co/cran/__linux__/bookworm/latest'))" > /etc/R/Rprofile.site && \
mkdir -p /root && \
Expand All @@ -45,5 +37,3 @@ RUN R -e "install.packages('geocompkg', repos = c('https://geocompx.r-universe.d
# rm main.zip
# RUN Rscript -e 'bookdown::render_book("geocompr", output_format = "bookdown::gitbook", clean = FALSE)'

# System-wide shell alias to make 'R' run 'arf' in interactive shells
RUN echo "alias R=arf" >> /etc/bash.bashrc
24 changes: 6 additions & 18 deletions qgis/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -46,36 +46,24 @@ RUN gpg --no-default-keyring --keyring /etc/apt/keyrings/ubuntugis-unstable-arch
RUN wget -qO /etc/apt/keyrings/qgis-archive-keyring.gpg https://download.qgis.org/downloads/qgis-archive-keyring.gpg
# RUN sh -c 'echo "deb [arch=amd64 signed-by=/etc/apt/keyrings/qgis-archive-keyring.gpg] https://qgis.org/ubuntugis-ltr `lsb_release -c -s` main" > /etc/apt/sources.list.d/qgis.list'
RUN apt-get update && apt-get -y --with-new-pkgs upgrade
RUN apt-get install -y --no-install-recommends qgis grass qgis-plugin-grass saga

RUN mkdir -p /home/rstudio/.local/share/QGIS/QGIS3/profiles/default/python/plugins \
&& wget -qO sagang_plugin.zip https://github.com/north-road/qgis-processing-saga-nextgen/archive/refs/heads/master.zip \
&& unzip -q sagang_plugin.zip -d /home/rstudio/.local/share/QGIS/QGIS3/profiles/default/python/plugins \
&& mv /home/rstudio/.local/share/QGIS/QGIS3/profiles/default/python/plugins/qgis-processing-saga-nextgen-master /home/rstudio/.local/share/QGIS/QGIS3/profiles/default/python/plugins/processing_saga_nextgen \
&& rm sagang_plugin.zip

# Outdated: install SAGA next generation plugin with the qgis-plugin-manager ###########################################
# RUN qgis-plugin-manager init
# RUN qgis-plugin-manager update
# install SAGA next generation plugin
# RUN qgis-plugin-manager install 'Processing Saga NextGen Provider'
RUN apt-get install -y --no-install-recommends qgis grass qgis-plugin-grass

# the rest is nice to have but not really necessary
# RUN qgis_process in a headless state
# ENV QT_QPA_PLATFORM=offscreen

# enable desired plugins
# RUN qgis_process plugins enable processing_saga_nextgen
# RUN qgis_process plugins enable grassprovider
USER root

# install R packages ##################################################################################################
# Step 1: Compile key spatial C/C++ packages from source so they link against
# the ubuntugis-unstable GDAL/PROJ/GEOS libraries (no CRAN binary available)
RUN R -e "install.packages(c('sf', 'terra', 'stars', 'lwgeom'), repos = c(CRAN = 'https://cloud.r-project.org'), type = 'source')"
# Step 2: Install everything else from RSPM binaries via pak
RUN R -e "install.packages('pak', repos = 'https://cloud.r-project.org'); pak::pak('geocompx/geocompkg', upgrade = TRUE)"
# Set the options() for R users:
RUN echo 'options(repos = "https://packagemanager.posit.co/cran/latest")' >> /usr/local/lib/R/etc/Rprofile.site
RUN Rscript -e "install.packages('pak', repos = 'https://cloud.r-project.org/')"
# RUN Rscript -e "pak::pak('r-spatial/sf')"
# RUN Rscript -e "pak::pak('rspatial/terra')"
RUN R -e "install.packages('geocompkg', upgrade = TRUE, dependencies = TRUE, force = TRUE, repos = c('https://geocompx.r-universe.dev', 'https://mlr-org.r-universe.dev', options('repos')))"



Expand Down
Loading