hadolint
This module inspects Dockerfiles for best practices, security issues,and style violations using hadolint.
Installation
dagger install github.com/softwaredevelop/daggerverse/hadolint@fdcdd2f195bb63b7c5379bea8d3832d683677b40Entrypoint
Return Type
Hadolint !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| image | String | - | Custom image reference in "repository:tag" format to use as a base container. |
Example
dagger -m github.com/softwaredevelop/daggerverse/hadolint@fdcdd2f195bb63b7c5379bea8d3832d683677b40 call \
func (m *MyModule) Example() *dagger.Hadolint {
return dag.
Hadolint()
}@function
def example() -> dagger.Hadolint:
return (
dag.hadolint()
)@func()
example(): Hadolint {
return dag
.hadolint()
}Types
Hadolint 🔗
Hadolint provides functions for linting Dockerfiles.
check() 🔗
Check runs hadolint on Dockerfiles found in the directory. It supports Dockerfile, Dockerfile.*, *.dockerfile, and Containerfile naming conventions.
Return Type
Container !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| source | Directory ! | - | Source directory containing Dockerfiles. |
| config | File | - | Optional hadolint configuration file (e.g. .hadolint.yaml). |
Example
dagger -m github.com/softwaredevelop/daggerverse/hadolint@fdcdd2f195bb63b7c5379bea8d3832d683677b40 call \
check --source DIR_PATHfunc (m *MyModule) Example(source *dagger.Directory) *dagger.Container {
return dag.
Hadolint().
Check(source)
}@function
def example(source: dagger.Directory) -> dagger.Container:
return (
dag.hadolint()
.check(source)
)@func()
example(source: Directory): Container {
return dag
.hadolint()
.check(source)
}checkWithConfig() 🔗
CheckWithConfig runs hadolint with a specific configuration file. Maintained for explicit backwards compatibility.
Return Type
Container !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| source | Directory ! | - | Source directory containing Dockerfiles. |
| file | File ! | - | Configuration file for hadolint. |
Example
dagger -m github.com/softwaredevelop/daggerverse/hadolint@fdcdd2f195bb63b7c5379bea8d3832d683677b40 call \
check-with-config --source DIR_PATH --file file:pathfunc (m *MyModule) Example(source *dagger.Directory, file *dagger.File) *dagger.Container {
return dag.
Hadolint().
Checkwithconfig(source, file)
}@function
def example(source: dagger.Directory, file: dagger.File) -> dagger.Container:
return (
dag.hadolint()
.checkwithconfig(source, file)
)@func()
example(source: Directory, file: File): Container {
return dag
.hadolint()
.checkWithConfig(source, file)
}