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

Use hadolint to lint Dockerfiles in CI #33

Open
jameslamb opened this issue Sep 17, 2019 · 1 comment
Open

Use hadolint to lint Dockerfiles in CI #33

jameslamb opened this issue Sep 17, 2019 · 1 comment
Labels
ci good first issue Good for newcomers help wanted Extra attention is needed

Comments

@jameslamb
Copy link
Collaborator

I discovered https://github.com/hadolint/hadolint tonight while looking at Apache Arrow (https://github.com/apache/arrow/blob/master/.hadolint.yaml).

It's a linter for Dockerfiles! We should use it on the Dockerfile(s) in this project.

@jameslamb jameslamb added help wanted Extra attention is needed good first issue Good for newcomers ci labels Sep 17, 2019
@jameslamb
Copy link
Collaborator Author

I ran hadolint Dockerfile today, and it turned up a few things

Dockerfile:13 DL3018 Pin versions in apk add. Instead of `apk add <package>` use `apk add <package>=<version>`
Dockerfile:27 DL4005 Use SHELL to change the default shell
Dockerfile:29 DL3013 Pin versions in pip. Instead of `pip install <package>` use `pip install <package>==<version>`
Dockerfile:41 DL3018 Pin versions in apk add. Instead of `apk add <package>` use `apk add <package>=<version>`
Dockerfile:41 DL3019 Use the `--no-cache` switch to avoid the need to use `--update` and remove `/var/cache/apk/*` when done installing packages
Dockerfile:51 DL3018 Pin versions in apk add. Instead of `apk add <package>` use `apk add <package>=<version>`
Dockerfile:51 DL4001 Either use Wget or Curl but not both
Dockerfile:51 DL4006 Set the SHELL option -o pipefail before RUN with a pipe in it. If you are using /bin/sh in an alpine image or if your shell is symlinked to busybox then consider explicitly setting your SHELL to /bin/ash, or disable this check
Dockerfile:80 DL3003 Use WORKDIR to switch to a directory
Dockerfile:84 DL3003 Use WORKDIR to switch to a directory
Dockerfile:99 DL3025 Use arguments JSON notation for CMD and ENTRYPOINT arguments

jameslamb added a commit to jameslamb/groundhog that referenced this issue Aug 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant