Description Usage Arguments Value Examples
View source: R/prepare_docker_image.R
Prepares a Docker r-base image for your R package by (1) building and installing the package on your system, (2) identifying R package dependencies of the package, (3) detecting the version numbers of the loaded and installed versions of these packages on your system, (4) linking the individual packages to the right repositories (either CRAN or local repos) and (5) writing Dockerfile and creating all other files needed to build the Docker r-base image.
1 2 3 4 5 |
pkg |
Path to a package, or within a package. |
dir_image |
|
print_dockerfile |
|
dir_install |
|
verbose |
|
r_version |
|
dependencies |
character vector of dependency types to include.
Choices are "Depends", "Imports", "LinkingTo", "Suggests",
and "Enhances". Defaults to |
base |
Logical indicating whether to include dependencies on base packages that are included in the R installation. Defaults to FALSE. |
recommended |
Logical indicating whether to include dependencies on recommended packages that are included in the R installation. Defaults to FALSE. |
dir_src |
|
prioritize_cran |
|
overwrite |
|
... |
optional arguments for 'install.packages()'. |
list
relevant meta data of the files, that constitute
the Docker image. As a side effect all necessary files for the Docker image -
including the resulting Dockerfile - are saved in the desired directory.
1 2 3 4 5 6 7 8 9 10 11 | # retrieve package directory for the 'dockr' package.
package_dir <- system.file(package = "dockr")
# this concludes the preparations.
# now for the real action.
# create all files for a Docker image for the package in the current directory.
img <- prepare_docker_image(pkg = package_dir, dir_image = tempdir(), dir_install = "temp")
# look up meta data for files for Docker image.
img
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.