Skip to content

docker: avoid the use of the ADD instruction#130

Merged
sanket-deepsource merged 2 commits intoDeepSourceCorp:masterfrom
hrideshmg:docker_add
Feb 25, 2025
Merged

docker: avoid the use of the ADD instruction#130
sanket-deepsource merged 2 commits intoDeepSourceCorp:masterfrom
hrideshmg:docker_add

Conversation

@hrideshmg
Copy link
Contributor

📌 Summary

This PR adds a checker to detect the use of the ADD instruction in Dockerfiles; If used for copying files ADD has certain side effects, for example - The ability to do automatic archive extraction and remote URL downloads which can introduce security risks. This checker warns the user and tells them to prefer the COPY instruction instead.

See - Dockerfile Best Practices

✅ Example

🚨 Flagged

ADD https://example.com/file.tar.gz /destination/

@vercel
Copy link

vercel bot commented Feb 25, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
globstar ⬜️ Ignored (Inspect) Visit Preview Feb 25, 2025 7:24pm

Signed-off-by: Sanket Saurav <sanket@deepsource.io>
@sanket-deepsource sanket-deepsource merged commit 893248d into DeepSourceCorp:master Feb 25, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants