replicatedhq / dockerfilelint

An opinionated Dockerfile linter.
https://www.fromlatest.io
MIT License
984 stars 83 forks source link

FROM scratch is a special case and shouldn't cause an error #145

Open iggy opened 4 years ago

iggy commented 4 years ago

FROM scratch is a special case in docker. It doesn't have any tags and in the build tooling it's a special case to not use an underlying image layer. This tool shouldn't error on a FROM line with scratch.

marccampbell commented 4 years ago

@iggy thanks for the report. I’ve added an integration test and am not able to reproduce this. Are you able to provide a Dockerfile that has this error?

iggy commented 4 years ago

I'm using dockerfilelint as part of GitHub's super-linter. Here is a link to it failing as part of that:

https://github.com/iggy/scurvy/runs/940683789?check_suite_focus=true#step:4:194

The line it's referencing:

https://github.com/iggy/scurvy/blob/master/Dockerfile#L74

marccampbell commented 4 years ago

Thanks @iggy

I added PR #154 which does address and make these pass. I’ll get it reviewed in tomorrow and a new version released.