Package 'dockerthis'

Title: Dockerthis: run any CLI tool on a Linux Container
Description: Dockerthis is an R package that simplifies the execution of command line tools within isolated Docker containers.
Authors: Lucio Rezende Queiroz [aut, cre]
Maintainer: Lucio Rezende Queiroz <[email protected]>
License: MIT + file LICENSE
Version: 0.0.0.9006
Built: 2024-11-03 06:06:43 UTC
Source: https://github.com/luciorq/dockerthis

Help Index


Build Docker Container Image

Description

Built Docker Image given a Dockerfile.

Usage

docker_build_image(
  dockerfile_path,
  image_name,
  force = FALSE,
  platform_arg = NULL
)

Arguments

dockerfile_path

Chracter. Path to Dockerfile.

image_name

Character. Name of the Image to be created.

force

Logical. Should image be removed before new build. Default FALSE.

platform_arg

Character. Platform string to be used, by default it will use the one configured by Docker, usually Linux with the same CPU architecture the same as the system, import options are c("linux/amd64", "linux/arm64", "linux/arm/v7"). Default NULL.


Interact with Docker Engine Client CLI

Description

Functions for interaction with Docker Images and Containers

  • docker_client_cmd() is the main function to interact with the docker client.

  • docker_list_images() return a data frame with all tagged images available for to user.

  • docker_list_containers() return a data frame with all containers and their state.

  • docker_remove_image() remove Docker image.

  • docker_remove_container() remove Docker container.

  • docker_start_container() start a stopped Docker container.

  • docker_stop_container() stop a running Docker container.

Usage

docker_client_cmd(..., verbose = TRUE)

docker_list_images()

docker_list_containers()

docker_remove_image(image_name)

docker_remove_container(container_name)

docker_stop_container(container_name)

docker_start_container(container_name)

Arguments

...

Character. Arguments to be passed to Docker CLI.

verbose

Logical. Should output from CLI be printed. Default: TRUE.

image_name

Character. Name or ID of the Image.

container_name

Character. Name or ID of the Container.


Run Command on a Running Docker Container

Description

Run Command on a Running Docker Container

Usage

docker_exec(cmd, ..., container_name, verbose = TRUE)

Arguments

cmd

Character. Command to run.

...

Character. Additional arguments passed to cmd.

container_name

Name of Docker Container.

verbose

Logical. Print execution output while running. Default: TRUE.


Create and Run Command on a New Docker Container

Description

Start a new container to run command line tools inside Linux containers using Docker Client CLI.

Usage

docker_run(
  cmd,
  ...,
  container_name,
  image_name,
  docker_args = NULL,
  mount_paths = NULL,
  verbose = TRUE
)

Arguments

cmd

Character. Command to run.

...

Character. Additional arguments passed to cmd.

container_name

Name of Docker Container.

image_name

Name of Container Image.

docker_args

Character vector. Arguments passed to ⁠docker run⁠ command.

mount_paths

Character vector. Host paths to be mounted in container.

verbose

Logical. Print execution output while running. Default: TRUE.


Is Docker Client CLI available

Description

Test if Docker CLI is available on PATH.

Usage

is_docker_available()