extract_session_image: Optains a session info from R executed in a container
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
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
Examples
Run this code# NOT RUN {
extract_session_image("rocker/geospatial:3.3.3")
# }
Run the code above in your browser using DataLab