Dockerfile instructions

Dockerfile ADD

Transfers sources into the image and by default extracts recognized local tar archives. Remote inputs have different rules and version-dependent options. Prefer COPY for simple files; only use reviewed local archive in this example. Inspect the supplied synthetic archive members; do not introduce remote sources.

Formal Syntax & Structure

docker syntaxdocker
ADD <src> ... <dest>

Parameters & Attributes

NameTypeDescription
srcstringReviewed local file/archive source.
deststringImage destination.

Working Example

Example Snippetdocker
FROM busybox:1.37ADD bundle.tar /app/COPY bundle.tar /archive.tarCMD ["sh", "-c", "cat /app/note.txt; test -f /archive.tar && echo archive-present"]
Docker Reference