{"id":14066485,"url":"https://github.com/signaturescience/pracpac","last_synced_at":"2026-02-19T02:33:03.605Z","repository":{"id":133303412,"uuid":"604227051","full_name":"signaturescience/pracpac","owner":"signaturescience","description":"Practical R Packaging with Docker","archived":false,"fork":false,"pushed_at":"2025-09-19T20:16:07.000Z","size":1153,"stargazers_count":38,"open_issues_count":3,"forks_count":1,"subscribers_count":6,"default_branch":"main","last_synced_at":"2026-01-27T13:35:56.256Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://signaturescience.github.io/pracpac/","language":"R","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/signaturescience.png","metadata":{"files":{"readme":"README.Rmd","changelog":"NEWS.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":"CITATION.cff","codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2023-02-20T15:50:49.000Z","updated_at":"2025-12-21T15:30:50.000Z","dependencies_parsed_at":"2025-04-11T20:55:31.586Z","dependency_job_id":"0808b716-608d-4158-843e-0c4b39f05717","html_url":"https://github.com/signaturescience/pracpac","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/signaturescience/pracpac","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/signaturescience%2Fpracpac","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/signaturescience%2Fpracpac/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/signaturescience%2Fpracpac/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/signaturescience%2Fpracpac/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/signaturescience","download_url":"https://codeload.github.com/signaturescience/pracpac/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/signaturescience%2Fpracpac/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29601093,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-19T00:59:38.239Z","status":"online","status_checked_at":"2026-02-19T02:00:07.702Z","response_time":117,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":[],"created_at":"2024-08-13T07:05:07.605Z","updated_at":"2026-02-19T02:33:03.577Z","avatar_url":"https://github.com/signaturescience.png","language":"R","funding_links":[],"categories":["R"],"sub_categories":[],"readme":"---\noutput: github_document\n---\n\n\u003c!-- README.md is generated from README.Rmd. Please edit that file --\u003e\n\n```{r, include = FALSE}\nknitr::opts_chunk$set(\n  collapse = TRUE,\n  comment = \"#\u003e\",\n  fig.path = \"man/figures/README-\",\n  out.width = \"100%\"\n)\n```\n\n# pracpac \u003ca href='https://github.com/signaturescience/pracpac'\u003e\u003cimg src='man/figures/logo.png' align=\"right\" height=\"180\" /\u003e\u003c/a\u003e\n\n\u003c!-- badges: start --\u003e\n[![R-CMD-check](https://github.com/signaturescience/pracpac/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/signaturescience/pracpac/actions/workflows/R-CMD-check.yaml)\n[![CRAN status](https://www.r-pkg.org/badges/version/pracpac)](https://CRAN.R-project.org/package=pracpac)\n[![arXiv](https://img.shields.io/badge/arXiv-2303.07876-b31b1b.svg)](https://arxiv.org/abs/2303.07876)\n\u003c!-- badges: end --\u003e\n\n**pracpac**: Practical R Packaging with Docker\n\nThe goal of pracpac is to provide a usethis-like interface to create Docker images from R packages under development. The pracpac package uses renv by default, ensuring reproducibility by building dependency packages inside the container image mirroring those installed on the developer's system. The pracpac package can be used to containerize any R package and deploy with other domain-specific non-R tools, Shiny applications, or entire data analysis pipelines.\n\n## Installation\n\nInstall pracpac from CRAN with:\n\n```r\ninstall.packages(\"pracpac\")\n```\n\nInstall the development version of pracpac from [GitHub](https://github.com/signaturescience/pracpac) with:\n\n```r\n# install.packages(\"devtools\")\ndevtools::install_github(\"signaturescience/pracpac\", build_vignettes = TRUE)\n```\n\n## Example\n\nDetailed documentation is available in the [basic usage](https://signaturescience.github.io/pracpac/articles/basic-usage.html) and [use cases](https://signaturescience.github.io/pracpac/articles/use-cases.html) vignettes:\n\n```{r, eval=FALSE}\nvignette(\"basic-usage\", package=\"pracpac\")\nvignette(\"use-cases\", package=\"pracpac\")\n```\n\nIn the most simple example, running `use_docker()` inside of a package directory will (1) capture all the package dependencies installed on the developers system using [renv](https://rstudio.github.io), (2) build the package source tar.gz, (3) create a Dockerfile which builds an image with the package and its entire dependency chain, and (4) optionally builds a Docker image with tags set using the version in the package `DESCRIPTION`. The Dockerfile, `renv.lock` file, and the package source tar.gz file will all be placed into a `docker/` subdirectory of the package, which is added to the package's `.Rbuildignore`. The workflow is shown in the figure below.\n\n![Pracpac workflow](man/figures/pracpac-workflow.png)\n\nFor example, running `use_docker()` in the example package included in pracpac at [inst/hellow](https://github.com/signaturescience/pracpac/tree/main/inst/hellow) will produce a Dockerfile with the following contents:\n\n```Dockerfile\nFROM rocker/r-ver:latest\n\n## copy the renv.lock into the image\nCOPY renv.lock /renv.lock\n\n## install renv and biocmanager\nRUN Rscript -e 'install.packages(c(\"renv\",\"BiocManager\"), repos=\"https://cloud.r-project.org\")'\n\n## set the renv path var to the renv lib\nENV RENV_PATHS_LIBRARY renv/library\n\n## restore packages from renv.lock\nRUN Rscript -e 'renv::restore(lockfile = \"/renv.lock\", repos = NULL)'\n\n## copy in built R package\nCOPY hellow_0.1.0.tar.gz /hellow_0.1.0.tar.gz\n\n## run script to install built R package from source\nRUN Rscript -e \"install.packages('/hellow_0.1.0.tar.gz', type='source', repos=NULL)\"\n```\n\nAnd an `renv.lock` with the dependencies of `hellow` (in this case just the `praise` package):\n\n```json\n{\n  \"R\": {\n    \"Version\": \"4.0.2\",\n    \"Repositories\": [\n      {\n        \"Name\": \"CRAN\",\n        \"URL\": \"https://cran.rstudio.com\"\n      }\n    ]\n  },\n  \"Packages\": {\n    \"praise\": {\n      \"Package\": \"praise\",\n      \"Version\": \"1.0.0\",\n      \"Source\": \"Repository\",\n      \"Repository\": \"CRAN\",\n      \"Hash\": \"a555924add98c99d2f411e37e7d25e9f\",\n      \"Requirements\": []\n    }\n  }\n}\n```\n\nBy default, `use_docker()` does not actually build the image. You can build the image with `build_image()` after running `use_docker()`, or in one step using `use_docker(build=TRUE)`. This two-step procedure is useful because other use cases may require edits to the Dockerfile to install system libraries, or copy in Shiny app or pipeline-specific code. See the [help page for `?use_docker`](https://signaturescience.github.io/pracpac/reference/use_docker.html) and the [use cases vignette](https://signaturescience.github.io/pracpac/articles/use-cases.html) (`vignette(\"use-cases\", package=\"pracpac\")`) for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsignaturescience%2Fpracpac","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsignaturescience%2Fpracpac","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsignaturescience%2Fpracpac/lists"}