Skip to contents

Package Overview

Introduction to the dockitect package and its core concepts

dockitect dockitect-package
dockitect: Create and Validate Dockerfiles Programmatically

Core Dockerfile Functions

Essential functions for creating and managing Dockerfiles

dockerfile()
Create a new dockerfile object
is_dockerfile()
Test if an object is a dockerfile
has_instruction()
Check if a dockerfile has a specific instruction
check_dockerfile()
Ensure an object is a dockerfile
print(<dockerfile>)
Print method for dockerfile objects

Creating Dockerfile Instructions

Functions for adding different Docker instructions to a Dockerfile

dfi_add()
Add an ADD instruction to a dockerfile
dfi_arg()
Add an ARG instruction to a dockerfile
dfi_cmd()
Add a CMD instruction to a dockerfile
dfi_copy()
Add a COPY instruction to a dockerfile
dfi_entrypoint()
Add an ENTRYPOINT instruction to a dockerfile
dfi_env()
Add an ENV instruction to a dockerfile
dfi_expose()
Add an EXPOSE instruction to a dockerfile
dfi_from()
Add a FROM instruction to a dockerfile
dfi_healthcheck()
Add a HEALTHCHECK instruction to a dockerfile
dfi_label()
Add a LABEL instruction to a dockerfile
dfi_maintainer()
Add a MAINTAINER instruction to a dockerfile (deprecated)
dfi_onbuild()
Add an ONBUILD instruction to a dockerfile
dfi_run()
Add a RUN instruction to a dockerfile
dfi_shell()
Add a SHELL instruction to a dockerfile
dfi_stopsignal()
Add a STOPSIGNAL instruction to a dockerfile
dfi_user()
Add a USER instruction to a dockerfile
dfi_volume()
Add a VOLUME instruction to a dockerfile
dfi_workdir()
Add a WORKDIR instruction to a dockerfile

Dockerfile Input/Output

Functions for reading and writing Dockerfiles

read_dockerfile()
Read a Dockerfile from a file
write_dockerfile()
Write a dockerfile to a file

Dockerfile Modification

Functions for modifying Dockerfiles

dfm_group_similar()
Group similar instructions in a dockerfile
dfm_move_line()
Move a line in a dockerfile
dfm_remove_line()
Remove a line from a dockerfile
dfm_replace_line()
Replace a line in a dockerfile
dfm_sort_by_instruction()
Sort instructions in a dockerfile by type

Core Dockerignore Functions

Essential functions for creating and managing .dockerignore files

dockerignore()
Create a new dockerignore object
is_dockerignore()
Test if an object is a dockerignore
check_dockerignore()
Ensure an object is a dockerignore
print(<dockerignore>)
Print method for dockerignore objects
c(<dockerignore>)
Combine multiple dockerignore objects

Dockerignore Pattern Instruction Management

Functions for adding and removing patterns in .dockerignore files

di_add()
Add patterns to a dockerignore object
di_remove()
Remove patterns from a dockerignore object
di_replace()
Replace patterns in a dockerignore object

Dockerignore Input/Output

Functions for reading and writing .dockerignore files

read_dockerignore()
Read a .dockerignore file
write_dockerignore()
Write a dockerignore object to a file

Dockerfile Generation from Environments

Functions for generating Dockerfiles from various sources

dk_from_description()
Create a dockerfile from a DESCRIPTION file
dk_from_renv()
Create a dockerfile from an renv.lock file
dk_from_script()
Create a dockerfile from an R script
dk_from_session()
Create a dockerfile from the current R session
dk_add_sysreqs()
Add system requirements for R packages to a dockerfile

Dockerfile Templates

Ready-to-use templates for common R container scenarios

dk_template_base()
Create a base R dockerfile template
dk_template_shiny()
Create a Shiny app dockerfile template
dk_template_plumber()
Create a Plumber API dockerfile template
dk_register_template()
Register a custom dockerfile template
dk_template_custom()
Create a dockerfile from a custom template

Dockerignore Templates

Ready-to-use templates for common .dockerignore patterns

dk_template_ignore_common()
Create a dockerignore template for common ignore patterns
dk_template_ignore_data()
Create a dockerignore template for data-related files
dk_template_ignore_editor()
Create a dockerignore template for editor-related files
dk_template_ignore_git()
Create a dockerignore template for Git-related files
dk_template_ignore_node()
Create a dockerignore template for Node.js/JavaScript projects
dk_template_ignore_os()
Create a dockerignore template for OS-related files
dk_template_ignore_packrat()
Create a dockerignore template for packrat-related files
dk_template_ignore_python()
Create a dockerignore template for Python projects
dk_template_ignore_r()
Create a dockerignore template for R-related files
dk_template_ignore_raw_data()
Create a dockerignore template for raw data directories
dk_template_ignore_renv()
Create a dockerignore template for renv-related files

Utility Functions

Helper functions for working with Docker environments

determine_package_manager()
Determine the package manager from a base image
determine_os()
Determine the operating system from a base image
map_to_sysreqs_platform()
Map package manager to sysreqs platform
generate_pkg_install_cmd()
Generate package installation commands for different package managers