ADD

The Dockerfile instruction that copies files like COPY, but can also fetch URLs and unpack local archives.

In more detail

Because ADD automatically extracts tar archives and can download from the network, it can do more than you intended. Use COPY for plain files and reach for ADD only when you need its extra behaviour, ideally with a checksum for remote files.

Example

ADD --checksum=sha256:<digest> https://example.com/tool.tgz /opt/

Related terms

Taught in

References

Certification courses