cnescatlab / sonar-hadolint-plugin

sonar-hadolint-plugin is a SonarQube plugin used to integrate Hadolint results
GNU General Public License v3.0
12 stars 0 forks source link

Support OCI Containerfile spec #35

Open ReDemoNBR opened 1 year ago

ReDemoNBR commented 1 year ago

Intro

For some developers, Containerfile is just an alternative name for Dockerfile. For some others, Containerfile and Dockerfile are used in order to explicitly inform the format (oci vs `docker) of the container.

And there are projects (including some of mine) using Containerfile names. However this plugin doesn't detect the files due to the naming difference.

Differences between OCI and Docker

For the sake of brevity, I won't go fully deep into the topic as this is not the place for discussing it. But there are actually some differences between OCI and Docker specifications, but Docker specification is essentially an extension of OCI specification.

Hadolint

Hadolint is able to lint both formats without any problem.

$ hadolint path/to/Containerfile # Works like a charm

Feature request

My request is about detecting Containerfile as an alternative name to Dockerfile and linting them just like it would with Dockerfiles. As Hadolint does that out-of-the-box, this should not require any change to Hadolint.

Extra info

Containerfile spec: https://www.mankier.com/5/Containerfile Buildah on Containerfile vs Dockerfile and preferring Containerfile: https://github.com/containers/buildah/discussions/3170