Skip to content

Add libglpk, tippecanoe, and PPM binary R installs to devcontainer postCreate #119

@Robinlovelace

Description

@Robinlovelace

Background

While setting up the criticalissues devcontainer for an Oxfordshire road safety pipeline, we hit several missing system dependencies and slow install patterns. The fixes are small but meaningfully improve the out-of-the-box experience for anyone doing spatial / road-network R work in this container.

Proposed additions to postCreate.sh (or equivalent)

1. System packages

apt-get install -y libglpk-dev libglpk40 xz-utils

libglpk is required by CRAN packages such as igraph and glmmTMB. Without it, those packages either fail to install or produce a runtime error. xz-utils is needed for decompressing certain OS data archives.

2. tippecanoe (vector tile generation)

if ! command -v tippecanoe &> /dev/null; then
    git clone https://github.com/felt/tippecanoe.git
    cd tippecanoe && make -j && make install && cd ..
    rm -rf tippecanoe
fi

tippecanoe is the standard tool for building PMTiles / MBTiles from GeoJSON. It is not in apt and must be built from source. Adding it here avoids every project having to document this step.

3. Posit Package Manager (PPM) binary R installs

options(repos = c(PPM = "https://packagemanager.posit.co/cran/__linux__/bookworm/latest"))

Setting this as the default repo for Bookworm containers turns 20–30 minute source builds of packages like sf, duckdb, brms into ~2-minute binary installs. This is the single highest-leverage change for dev container startup time.

Reference implementation

A working postCreate.sh using all three improvements can be found in:
https://github.com/Robinlovelace/criticalissues/blob/ox-generalisable/.devcontainer/postCreate.sh

Happy to submit a PR if the approach fits the repo's structure.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions