replicatedhq / dockerfilelint

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

Glob pattern or directory as source #91

Open sky-code opened 6 years ago

sky-code commented 6 years ago

Add a feature to specify a glob pattern instead of single file as input or directory with recursive search for Dockerfiles. I have a project with many dockerfiles in special directory and I want to lint them all, ideally with glob pattern I will do something like this

$ docker run -v `pwd`/docker:/docker replicated/dockerfilelint /docker/**/Dockerfile

or specify a directory like this for search all Dockerfiles inside

$ docker run -v `pwd`/docker:/docker replicated/dockerfilelint /docker/
nexdrew commented 6 years ago

Note that the CLI does support multiple files as different arguments, so using a glob would work if we can get the shell to do the glob expansion for us.

Otherwise, this is a good suggestion.

mcandre commented 5 years ago

Please have dockerfilelint do the recursive globbing itself when scanning for Dockerfile's. Glob notation is difficult to get right, and many shells (e.g. Windows Command Prompt) do not glob on behalf of command line applications.