This function creates a Dockerfile at the root of the project based on a
template. The Docker image is based on
rocker/rstudio. The whole project
will be copied in the image and R packages will be installed (using
renv::restore() or remotes::install_deps()).
In addition a .dockerignore file is added to ignore some files/folders
while building the image.
User can customize this Dockerfile (e.g. system dependencies). He/she
can also use a different default Docker image (i.e. tidyverse, verse,
geospatial, etc.). For more information:
https://github.com/rocker-org/rocker-versioned2
By default the versions of R and renv (if applicable) specified in the
Dockerfile are the same as the local system.
Once the project is ready to be released, user must build the Docker image by
running: docker build -t "image_name" .
Then to run a container, user must run:
docker run --rm -p 127.0.0.1:8787:8787 -e DISABLE_AUTH=true image_name
A new instance of RStudio Server is available on the Web browser at the URL:
127.0.0.1:8787.
Usage
add_dockerfile(
given = NULL,
family = NULL,
email = NULL,
open = TRUE,
overwrite = FALSE,
quiet = FALSE
)Arguments
- given
a
characterof length 1. The given name of the user (considered as the maintainer and code owner of the project).- family
a
characterof length 1. The family name of the user (considered as the maintainer and code owner of the project).a
characterof length 1. The email address of the user (considered as the maintainer and code owner of the project).- open
A logical value. If
TRUE(default) theDockerfileis opened in the editor.- overwrite
A logical value. If this file is already present and
overwrite = TRUE, it will be erased and replaced. Default isFALSE.- quiet
A logical value. If
TRUEmessages are deleted. Default isFALSE.
