DELAPARRA
Index
Color
NL
Category: Docker

ADD

Explained by Updated

What is ADD?

ADD: Like COPY but with extras: it can fetch remote URLs and auto-extract local tar archives. ADD copies files into a Docker image, like COPY, but with two extras. It can download a file from a URL, and it automatically unpacks local tar archives into the target folder. Those extras are also why Docker's own guidance recommends COPY for normal use. ADD can surprise you: an archive you meant to copy as a file gets unpacked instead. And downloads with ADD give little control over checksums or caching.

Definition source Coders Lingo, CC BY 4.0

Frequently asked questions about ADD

What should you keep in mind with ADD?

Use COPY by default. Reach for ADD only when you deliberately want a local archive unpacked in one step. For downloads, RUN curl with a checksum check, or a multi-stage build, is clearer and safer. Choosing the plainer instruction makes your Dockerfile easier for the next person to read without surprises.

What does an example of ADD look like?

ADD release.tar.gz /opt/app/

At a glance

CategoryDocker
Explained by
Updated

More Docker terms

All terms starting with A

Skills

Download all skills (zip)

Manuals

Related services

Need any help?

Stuck on one of these in your own project? Tell me what you are working on and I will tell you how I would approach it.