Skip to content

feat: slim down minimal image + docs on rocker-versioned2 mix-and-match#124

Open
Robinlovelace wants to merge 6 commits into
masterfrom
slim-minimal-image
Open

feat: slim down minimal image + docs on rocker-versioned2 mix-and-match#124
Robinlovelace wants to merge 6 commits into
masterfrom
slim-minimal-image

Conversation

@Robinlovelace
Copy link
Copy Markdown
Contributor

Summary

Reduces bloat in the minimal image and documents how users can build their own leaner images using rocker-versioned2.

Changes to minimal/Dockerfile

  • Installs only the geocompkg Imports (sf, terra, spData, units, dplyr, languageserver, methods) instead of pulling in all 60+ Suggests packages.
  • Adds strip /usr/local/lib/R/site-library/*/libs/*.so to remove debug symbols from RSPM binary libraries, following rocker-versioned2#340.
  • Adds rm -rf /var/lib/apt/lists/* at the end to reduce layer size.

Documentation (README.Rmd)

New section covering:

  • Examples of building leaner images with /rocker_scripts/install_geospatial.sh, install_rstudio.sh, etc.
  • Upstream suggestions for the Rocker project:
    • A geospatial-minimal variant without RStudio + heavy R packages
    • Smaller base images (debian-slim/ubuntu)
    • Multi-stage builds for pruning
    • Making strip opt-out instead of opt-in
    • A "pruned" rocker/geospatial tag

Notes

Docker daemon is unavailable on this machine so a local size comparison could not be performed. CI will confirm the new image size (target: <4GB).

Closes #123

- minimal/Dockerfile: install only essential geocompkg Imports (sf, terra,
  spData, units, dplyr, languageserver, methods) rather than full geocompkg
  (which brings 60+ Suggests). Also strip RSPM binary libraries and clean
  apt caches to reduce layer size.
- README.Rmd: add section on building leaner custom images with
  rocker-versioned2 install scripts, with examples and suggested upstream
  improvements for the Rocker project.
- Re-render README.md from README.Rmd.

Refs: #image-size-minimal
See also: rocker-org/rocker-versioned2#340
Drops RStudio Server and only installs sf, terra, spData, units, dplyr,
languageserver + GDAL/PROJ/GEOS dev libs. Size: 2.29GB vs 5.85GB base.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

minimal image is too big (5.43GB) — investigation and potential improvements

1 participant