{"id":14068227,"url":"https://github.com/bhaskarvk/docker","last_synced_at":"2025-07-30T03:32:36.993Z","repository":{"id":147621504,"uuid":"96778670","full_name":"bhaskarvk/docker","owner":"bhaskarvk","description":"R Package For Accessing Docker via Docker APIs ","archived":true,"fork":false,"pushed_at":"2017-07-14T16:52:33.000Z","size":102,"stargazers_count":21,"open_issues_count":2,"forks_count":3,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-12-04T09:38:57.201Z","etag":null,"topics":["api-client","docker","r","r-stats","test-automation"],"latest_commit_sha":null,"homepage":"https://bhaskarvk.github.io/docker/","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/bhaskarvk.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":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-07-10T13:08:59.000Z","updated_at":"2024-07-10T12:25:25.000Z","dependencies_parsed_at":null,"dependency_job_id":"e71f9087-2dc3-4762-ad3c-dd813596c90d","html_url":"https://github.com/bhaskarvk/docker","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/bhaskarvk/docker","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bhaskarvk%2Fdocker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bhaskarvk%2Fdocker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bhaskarvk%2Fdocker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bhaskarvk%2Fdocker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bhaskarvk","download_url":"https://codeload.github.com/bhaskarvk/docker/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bhaskarvk%2Fdocker/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267803984,"owners_count":24146527,"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","status":"online","status_checked_at":"2025-07-30T02:00:09.044Z","response_time":70,"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":["api-client","docker","r","r-stats","test-automation"],"created_at":"2024-08-13T07:06:02.222Z","updated_at":"2025-07-30T03:32:36.756Z","avatar_url":"https://github.com/bhaskarvk.png","language":"R","funding_links":[],"categories":["R"],"sub_categories":[],"readme":"---\noutput:\n  github_document:\n    html_preview: false\n---\n\n```{r, echo = FALSE}\nknitr::opts_chunk$set(\n  collapse = TRUE,\n  comment = \"#\u003e\",\n  fig.path = \"README-\"\n)\n```\n\n```{r, echo = FALSE}\ndescription \u003c- readLines(system.file(\"DESCRIPTION\", package='docker'))\nrvers \u003c- stringr::str_match(grep(\"R \\\\(\", description, value = TRUE), \"[0-9]{1,4}\\\\.[0-9]{1,4}\\\\.[0-9]{1,4}\")[1,1]\nversion \u003c- gsub(\" \", \"\", gsub(\"Version:\", \"\", grep(\"Version:\", description, value = TRUE)))\n```\n\n[![Project Status: Active – The project has reached a stable, usable state and is being actively developed.](http://www.repostatus.org/badges/latest/active.svg)](http://www.repostatus.org/#active) [![Last-changedate](https://img.shields.io/badge/last%20change-`r gsub('-', '--', Sys.Date())`-green.svg)](/commits/master) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) [![keybase verified](https://img.shields.io/badge/keybase-verified-brightgreen.svg)](https://gist.github.com/bhaskarvk/46fbf2ba7b5713151d7e) \n[![Travis-CI Build Status](https://travis-ci.org/bhaskarvk/docker.svg?branch=master)](https://travis-ci.org/bhaskarvk/docker) [![AppVeyor Build Status](https://ci.appveyor.com/api/projects/status/github/bhaskarvk/docker?branch=master\u0026svg=true)](https://ci.appveyor.com/project/bhaskarvk/docker) [![minimal R version](https://img.shields.io/badge/R%3E%3D-`r rvers`-6666ff.svg)](https://cran.r-project.org/) [![packageversion](https://img.shields.io/badge/Package%20version-`r version`-orange.svg?style=flat-square)](commits/master) [![CRAN_Status_Badge](http://www.r-pkg.org/badges/version/docker)](https://cran.r-project.org/package=docker) [![](http://cranlogs.r-pkg.org/badges/grand-total/docker)](http://cran.rstudio.com/web/packages/docker/index.html)\n\n# `docker`: An R Package for Docker\n\nThe `docker` R package provides access to the [docker](https://www.docker.com/) [API](https://docs.docker.com/engine/api/) to programmatically control a docker engine from R. The docker engine could be running either locally or remotely. The `docker` package uses the [reticulate](https://rstudio.github.io/reticulate/) R package to invoke the [Python SDK](https://docker-py.readthedocs.io/en/stable/) for docker. Using the Python SDK allows the `docker` package to have a very minimal foot-print and yet allow complete docker API access. The package has been tested against docker engine running on [Linux](https://www.docker.com/docker-ubuntu) and [Microsoft Windows](https://www.docker.com/docker-windows) and should also work under [MacOS](https://www.docker.com/docker-mac).\n\nControlling a docker engine from withing R can be useful for ...\n\n- Writing automated unit/integration tests for R packages against running services in docker containers. The package author can start a docker container, execute the tests, and tear the container down, all from withing the R code of the test.\n- Another use case is easy access to containerized services as part of a researchers reproducible research workflow. Having access to a containerized service ensures that the research code executes identically regardless of where it's run.\n\n\n## Installation\n\nRelease version\n\n```{r cran, eval=FALSE}\ninstall.packages('docker')\n```\n\nOR development version\n\n```{r github, eval=FALSE}\nif(!require(devtools)) {\n  install.packages(\"devtools\")\n}\ndevtools::install_github('bhaskarvk/docker')\n```\n\n## Setup\n\nBefore you can use this package you need to have Python  2.x (\u003e=2.7) or Python 3.x (\u003e=3.4) with the [docker](https://docker-py.readthedocs.io/en/stable/index.html) Python module which provides Python SDK for docker. A simple way to do this is using a [virtual environment](http://docs.python-guide.org/en/latest/dev/virtualenvs/). [virtualenvwrapper](http://docs.python-guide.org/en/latest/dev/virtualenvs/#virtualenvwrapper) makes setting up Python modules quite painless.\n\nOnce you have installed Python and setup `virtualenvwrapper` you need to create a new virtual environment and install the `docker` Python module in it.\n\n```bash\nmkvirtualenv --python=/usr/bin/python3 docker\nworkon docker\npip install docker\n\n# Test the SDK againsts a locally running docker\n# You should have a locally running docker for this.\npython -c 'import docker; print(docker.from_env().version())'\n```\n\nYou should see something like below, provided you had a locally running docker engine.\n\n```\n{'Os': 'linux', 'Arch': 'amd64', 'KernelVersion': '4.10.0-24-generic', 'GitCommit': '02c1d87', 'Version': '17.06.0-ce', 'BuildTime': '2017-06-23T21:19:04.990631145+00:00', 'MinAPIVersion': '1.12', 'GoVersion': 'go1.8.3', 'ApiVersion': '1.30'}\n```\n\n## Example\n\n```{r hello-world}\nreticulate::use_virtualenv(\"docker\")\nlibrary(docker)\nclient \u003c- docker$from_env()\ns \u003c- client$containers$run(\"alpine\", 'echo -n \"Hello World!\"', remove=TRUE)\nprint(s$decode(\"UTF-8\"))\n```\n\n## Usage\n\nAfter you have a successful 'Hellow World!' displayed above, you can call every API supported by the Python SDK using reticulate. Please consult the documents for the SDK and the reticulate R package in the links given above.\n\n## Code of Conduct\nPlease note that this project is released with a [Contributor Code of Conduct](CONDUCT.md). By participating in this project you agree to abide by its terms.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbhaskarvk%2Fdocker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbhaskarvk%2Fdocker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbhaskarvk%2Fdocker/lists"}