extract_session_image: Optains a session info from R executed in a container

Description Usage Arguments Value Note Examples

View source: R/utility-functions.R

Description

The function uses the given Docker image and executes the given expressions. To access the session information, a directory is mounted from the host into the container, to which the R session in the container saves an RData file with the sessionInfo object.

Usage

1
2
3
4
5
6
7
8
extract_session_image(
  docker_image,
  expr = c(),
  container_dir = "/tmp",
  local_dir = tempfile(pattern = "extract_bind_"),
  deleteTempfiles = TRUE,
  container_name = "containerit_capturer"
)

Arguments

docker_image

The name of the Docker image to run

expr

A list of expressions to be executed in the session

container_dir

The directory in the container where a local temp directory is mounted to, for saving the session info to a file (in lack of a COPY instruction)

local_dir

The local directory mounted into the container

deleteTempfiles

Remove used local_dir directory when done

container_name

The name used to run the container (which will be removed at the end)

Value

An object of class session info

Note

This function was created for test purposes in order to compare sessionInfos.

Examples

1
extract_session_image("rocker/geospatial:3.3.3")

o2r-project/containerit documentation built on June 28, 2021, 2:46 p.m.