Skip to contents

Parses a Dockerfile from disk into a dockerfile object that can be manipulated programmatically.

Usage

read_dockerfile(file)

Arguments

file

Path to Dockerfile

Value

A dockerfile object containing the parsed instructions and metadata

Details

The function handles line continuations and extracts metadata like the base image, package manager, OS, and R version (if applicable). Comments and empty lines are skipped.

See also

dockerfile() for creating a new dockerfile object & write_dockerfile() for writing a dockerfile to disk

Other dockerfile I/O functions: write_dockerfile()

Examples

if (FALSE) { # \dontrun{
# Read an existing Dockerfile
df <- read_dockerfile("path/to/Dockerfile")

# Modify it
df <- dfi_run(df, "apt-get update")
df
} # }