Which of the following distinguishes the ADD directive from the COPY directive?

Prepare for the Docker Certified Associate test with our comprehensive quizzes that include key questions and detailed explanations. Ace your certification!

The ADD directive differs from the COPY directive primarily in its capability to pull files from external URLs. When using ADD, you can specify a URL as the source, and Docker will download the file from that URL into the image during the build process. This added functionality makes ADD more versatile in certain scenarios than COPY, which strictly copies files and directories from the local build context.

While COPY is generally preferred for simple file copying due to its more predictable behavior, ADD's ability to handle remote files is a significant distinction. It's important to be aware that using ADD in situations outside of its specific advantages, like downloading files or unpacking archives, might lead to unnecessary complexity and potential issues, prompting best practices to favor COPY when the extra functionality is not needed.

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy