{"id":13425252,"url":"https://github.com/smaakage85/dockr","last_synced_at":"2026-01-20T02:44:20.544Z","repository":{"id":220084106,"uuid":"189997238","full_name":"smaakage85/dockr","owner":"smaakage85","description":"create lightweight docker image for an R package","archived":false,"fork":false,"pushed_at":"2019-12-15T17:01:01.000Z","size":438,"stargazers_count":12,"open_issues_count":2,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-10-28T03:39:48.691Z","etag":null,"topics":["docker","docker-container","docker-image","docker-images","r"],"latest_commit_sha":null,"homepage":null,"language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/smaakage85.png","metadata":{"files":{"readme":"README.Rmd","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-06-03T12:04:24.000Z","updated_at":"2021-11-03T06:27:13.000Z","dependencies_parsed_at":null,"dependency_job_id":"fd46aabb-bbb1-4533-9adc-920272d1d08e","html_url":"https://github.com/smaakage85/dockr","commit_stats":null,"previous_names":["smaakage85/dockr"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smaakage85%2Fdockr","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smaakage85%2Fdockr/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smaakage85%2Fdockr/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smaakage85%2Fdockr/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/smaakage85","download_url":"https://codeload.github.com/smaakage85/dockr/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243781935,"owners_count":20347167,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["docker","docker-container","docker-image","docker-images","r"],"created_at":"2024-07-31T00:01:08.343Z","updated_at":"2026-01-20T02:44:20.539Z","avatar_url":"https://github.com/smaakage85.png","language":"HTML","funding_links":[],"categories":["HTML"],"sub_categories":[],"readme":"---\n  output: github_document\n---\n\n\u003c!-- README.md is generated from README.Rmd. Please edit that file --\u003e\n\n```{r, echo = FALSE}\nknitr::opts_chunk$set(\n  collapse = TRUE,\n  comment = \"#\u003e\",\n  fig.path = \"man/figures/README-\"\n)\n```\n\n```{r setup_cran, echo = FALSE}\noptions(repos = c(CRAN = \"https://cran.rstudio.com/\"))\n```\n\n# dockr \u003cimg src=\"man/figures/dockr.png\" align=\"right\" height=140/\u003e\n[![Travis-CI Build Status](https://travis-ci.org/smaakage85/dockr.svg?branch=master)](https://travis-ci.org/smaakage85/dockr)\n[![CRAN\\_Release\\_Badge](http://www.r-pkg.org/badges/version-ago/dockr)](https://CRAN.R-project.org/package=dockr) [![CRAN\\_Download\\_Badge](http://cranlogs.r-pkg.org/badges/dockr)](https://CRAN.R-project.org/package=dockr)\n\n`dockr` is a small toolkit to build a lightweight Docker r-base container\nimage for your R package, in which the package itself is available. The Docker \nimage seeks to mirror your R session as close as possible with respect to R \nspecific dependencies. Both dependencies on CRAN R packages as well as local \nnon-CRAN R packages will be included in the Docker container image.\n\n## Installation\n\nInstall the development version of `dockr` with:\n\n```{r install_github, eval = FALSE}\nremotes::install_github(\"smaakage85/dockr\")\n```\n\nOr install the version released on CRAN: \n\n```{r install_cran, eval = FALSE}\ninstall.packages(\"dockr\")\n```\n\n## Workflow\n\nIn order to create the files, that will constitute the Docker image, simply \ninvoke the `prepare_docker_image()` function and point to the folder with your \npackage. \n\nThe workflow of `prepare_docker_image()` is summarized below:\n\n1. Build and install the package on your system\n2. Identify R package dependencies of the package\n3. Detect the version numbers of the loaded and installed versions of these \npackages on your system\n4. Link the individual packages to the right repositories (either CRAN or local repos)\n5. Write Dockerfile and create all other files needed to build the Docker r-base image\n\nNow, I will let `dockr` do its magic and create the files for a Docker r-base\ncontainer image, in which `dockr` is installed together with all of the R \npackage dependencies, `dockr` needs to run.\n\nBeware that the files for the Docker image are created as side-effects of the \nfunction call (under the 'dir_image' directory). Also the package is \ninstalled as a side effect (in the 'dir_install' directory).\n\n```{r create_image, warning = FALSE, message = FALSE}\nlibrary(dockr)\nimage_dockr \u003c- prepare_docker_image(\".\", dir_image = tempdir(), \n                                    dir_install = \"temp\")\n```\n\nGreat, all necessary files for the Docker image have been created, and you \ncan build the Docker image right away by following the instructions. It is as \neasy as that! Yeah!\n\n## What about non-R dependencies?\n\n`dockr` does _not_ deal with non-R dependencies at this point. \nIn case that, for instance, your package has any Linux specific dependencies, \nyou will have to install them yourself in the Docker container image. For that\npurpose you can edit the Dockerfile further with the 'write_lines_to_file' \nfunction.\n\n## Contact\n\nI hope, that you will find `dockr` useful.\n\nPlease direct any questions and feedbacks to [me](mailto:lars_kjeldgaard@hotmail.com)!\n\nIf you want to contribute, open a [PR](https://github.com/smaakage85/dockr/pulls).\n\nIf you encounter a bug or want to suggest an enhancement, please [open an issue](https://github.com/smaakage85/dockr/issues).\n\nBest, \nsmaakagen\n\n\n\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsmaakage85%2Fdockr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsmaakage85%2Fdockr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsmaakage85%2Fdockr/lists"}