Replaces a line at the specified position with new content.
See also
dfm_add_line()
for adding a line &
dfm_remove_line()
for removing a line
Other dockerfile modification functions:
dfm_add_line()
,
dfm_group_similar()
,
dfm_move_line()
,
dfm_remove_line()
,
dfm_sort_by_instruction()
Examples
df <- dockerfile() |>
dfi_from("rocker/r-ver:4.4.0") |>
dfi_run("apt-get update")
# Replace the RUN instruction with a more comprehensive one
df <- dfm_replace_line(df, 2,
"RUN apt-get update && apt-get install -y libcurl4-openssl-dev && apt-get clean")