β Cloud & DevOpsQuestion 14 of 50
What is the difference between COPY and ADD in a Dockerfile?
π Explanation
COPY only moves files from the build context into the image, while ADD does that too but also supports extracting local tar archives and fetching files from URLs. Since ADD's extra behavior can be unpredictable, COPY is generally preferred unless you specifically need those features. The wrong options either swap the capabilities between COPY and ADD, or incorrectly claim they are identical or used at runtime, none of which matches how these instructions actually work.
Related questions
- How do Docker, ECS, and EKS relate to each other in AWS?
- Is CORS a backend security mechanism? Why or why not?
- What problem do RTO and RPO solve in disaster recovery planning, and what does each one measure?
- What is the difference between SSL and TLS?
- AWS Lambda is slow due to cold starts - how can you mitigate this?
β PreviousNo login needed