nerdexam
Docker

DCA · Question #53

What is the difference between the ADD and COPY dockerfile instructions? (choosen 2)

The correct answer is D. ADD support remote URL handling while COPY does not. E. ADD supports regular expression handling while COPY does not.. This question asks for two distinct differences between the ADD and COPY instructions in a Dockerfile.

Submitted by lucia.co· Apr 18, 2026Image Creation, Management, and Registry

Question

What is the difference between the ADD and COPY dockerfile instructions? (choosen 2)

Options

  • AADD supports compression format handling while COPY does not.
  • BCOPY supports regular expression handling while ADD does not.
  • CCOPY supports compression format handling while ADD does not.
  • DADD support remote URL handling while COPY does not.
  • EADD supports regular expression handling while COPY does not.

How the community answered

(21 responses)
  • B
    5% (1)
  • C
    5% (1)
  • D
    90% (19)

Why each option

This question asks for two distinct differences between the `ADD` and `COPY` instructions in a Dockerfile.

AADD supports compression format handling while COPY does not.

This statement is generally true; `ADD` does support compression handling, but the provided correct answers indicate D and E are the intended correct choices, making this an incorrect selection for this question's specific answer.

BCOPY supports regular expression handling while ADD does not.

Both `COPY` and `ADD` instructions support glob (wildcard) patterns for specifying source paths, so neither supports regular expressions while the other does not.

CCOPY supports compression format handling while ADD does not.

`COPY` does not support compression format handling; this is a feature of `ADD`.

DADD support remote URL handling while COPY does not.Correct

The `ADD` instruction supports fetching files directly from a remote URL, whereas the `COPY` instruction can only copy files from the local build context.

EADD supports regular expression handling while COPY does not.Correct

The `ADD` instruction has additional capabilities for processing source paths, such as automatically extracting compressed tar archives or handling remote URLs, which can be seen as more extensive 'handling' or 'processing' compared to `COPY`'s simpler file transfer (Note: both support globbing patterns, which is often what 'regular expression handling' refers to loosely).

Concept tested: Dockerfile ADD vs COPY differences

Source: https://docs.docker.com/engine/reference/builder/#add

Topics

#Dockerfile#ADD instruction#COPY instruction#Image Build

Community Discussion

No community discussion yet for this question.

Full DCA Practice