knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "man/figures/README-",
  out.width = "100%"
)

# libraries
library(tibble)
library(dplyr)
library(purrr)
devtools::load_all(".")

# dockerhub account
account = desc::desc_get_field("Config/Dockerhub/Account")

mdsrocker

badge_name = "Docker Image CI"
src = glue::glue("https://github.com/{account}/mdsrocker/actions/workflows/publish-docker-images.yml/badge.svg")
href = glue::glue("https://github.com/{account}/mdsrocker/actions/workflows/publish-docker-images.yml")
glue("[![{badge_name}]({src})]({href})")

The goal of mdsrocker is to provide a framework for building a stack of version-stable docker images based on rocker/r-ver, an ubuntu-based docker image containing version-stable base R & a set of src build tools.

We follow the version tag approach of the rocker-project, using the image tag for specifying which version of R is desired (e.g. r paste("rocker/r-ver:", as.character(getRversion()))). Omit the tag or specify :latest to always receive the latest versions.

Image stack

stack = mdsrocker_dockerfiles |> 
  dplyr::select(image, description)

stack = stack |> 
  dplyr::mutate(
    image = kableExtra::cell_spec(
      image, 
      "html",
      link = glue::glue("https://hub.docker.com/r/{account}/{image}")
    )
  )

kableExtra::kable(stack, escape = FALSE)

Architecture

This building system is designed as an R package.

Data

All relevant information is stored in two data.frames (as package data):

kableExtra::kable(mdsrocker_installation)
mdsrocker_dockerfiles |> 
  dplyr::select(-description) |> 
  kableExtra::kable()

Scripts & Files

In this building system,

Updating

All scripts are automatically updated in the Github Actions Workflow update-building-system.yml (by running execute.R) when commited and pushed.

For adding changes (e.g. additional R packages), do:

  1. git pull the latest changes in the remote repository,
  2. run:
  3. mdseasy::easy_version(element = "dev", check_renv = FALSE, check_gitlab_ci = FALSE, push = FALSE)
  4. update and run the code generating the package data in data-raw/datasets.R,
  5. run:
  6. devtools::document()
  7. devtools::check()
  8. update NEWS.md
  9. run
  10. gert::git_commit_all("YOUR COMMIT MESSAGE")
  11. mdseasy::easy_version(check_renv = FALSE, check_gitlab_ci = FALSE)

Execution

The Github Actions workflow publish-docker-images.yml is:



meterds/mdsrocker documentation built on Dec. 2, 2023, 11:56 p.m.