Writes a dockerfile
object to disk as a Dockerfile.
Details
When multiline = TRUE
(the default), long RUN
commands with &&
will be formatted with line continuations (\
) for better readability.
This makes the Dockerfile more maintainable without changing its functionality.
See also
read_dockerfile()
for reading a Dockerfile from disk &
dockerfile()
for creating a new dockerfile object
Other dockerfile I/O functions:
read_dockerfile()
Examples
if (FALSE) { # \dontrun{
# Create and write a simple Dockerfile
dockerfile() |>
dfi_from("rocker/r-ver:4.4.0") |>
dfi_run("apt-get update") |>
write_dockerfile()
# Specify a different file name
dockerfile() |>
dfi_from("rocker/r-ver:4.4.0") |>
write_dockerfile("Dockerfile.dev")
} # }