Differentiate between COPY and ADD commands that are used in a Dockerfile?

DWQA QuestionsCategory: QuestionsDifferentiate between COPY and ADD commands that are used in a Dockerfile?
Editor Staff asked 1 month ago

Differentiate between COPY and ADD commands that are used in a Dockerfile?

1 Answers
Editor Staff answered 1 month ago

Both the commands have similar functionality, but COPY is more preferred because of its higher transparency level than that of ADD.
COPY provides just the basic support of copying local files into the container whereas ADD provides additional features like remote URL and tar extraction support.