Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DL3020: Docs: Incorrect reference in the rationale #991

Open
2 of 3 tasks
thernstig opened this issue Dec 17, 2023 · 0 comments
Open
2 of 3 tasks

DL3020: Docs: Incorrect reference in the rationale #991

thernstig opened this issue Dec 17, 2023 · 0 comments

Comments

@thernstig
Copy link

  • This is a bug report
  • This is a feature request
  • I searched existing issues before opening this one

Expected behavior

The rationale should always be properly described to avoid users implementing an incorrect Dockerfile. The rationale should thus be updated.

Actual behavior

https://github.com/hadolint/hadolint/wiki/DL3020 states:

For other items (files, directories) that do not require ADD’s tar auto-extraction capability, you should always use COPY.

This statement is not included anymore when checking the reference page https://docs.docker.com/develop/develop-images/dockerfile_best-practices/#add-or-copy. Instead this page says:

The ADD instruction is best for when you need to download a remote artifact as part of your build. ADD is better than manually adding files using something like wget and tar, because it ensures a more precise build cache. ADD also has built-in support for checksum validation of the remote resources, and a protocol for parsing branches, tags, and subdirectories from Git URLs.

The rule DL3020 in itself is correct though, since it is about "Use COPY instead of ADD for files and folders", and it has an exception regarding tar files. But the quote should be removed or changed to a non-quote as that quote cannot be found anymore on https://docs.docker.com/develop/develop-images/dockerfile_best-practices/#add-or-copy.

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

No branches or pull requests

1 participant