Adds one or more patterns to a dockerignore object, avoiding duplicates.
Details
Patterns follow the same syntax as .gitignore files:
Lines starting with
#are commentsBlank lines are ignored
Trailing slashes
/specify directoriesPatterns with special characters like
*,?, and[]use glob syntaxLines starting with
!negate a pattern (include a file that would otherwise be ignored)
See also
di_remove() for removing patterns &
di_replace() for replacing patterns
Other dockerignore instruction functions:
di_remove(),
di_replace()
Examples
di <- dockerignore()
# Add a single pattern
di <- di_add(di, ".git/")
# Add multiple patterns
di <- di_add(di, c("*.log", "node_modules/", "*.tmp"))