dogecoin / dogecoin/docker

QA: Add Dockerfile linter

Open
#43 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
36
Forks
17
PR merge metrics
No merged PRs in 30d

Description

Currently the most complete Dockerfile linter seems to be `hadolint`, this basically implements the same principles from pylint and eslint+[semi]standard to Dockerfiles.

Open items on main as of dc0a034a:

- [x] [DL3027](https://github.com/hadolint/hadolint/wiki/DL3027): Do not use apt as it is meant to be a end-user tool, use apt-get or apt-cache instead - #42 at https://github.com/dogecoin/docker/blob/dc0a034a59dc3eb76ccaeb67956d080819bc90e1/1.14.5/bullseye/Dockerfile#L28 and https://github.com/dogecoin/docker/blob/dc0a034a59dc3eb76ccaeb67956d080819bc90e1/1.14.5/bullseye/Dockerfile#L93
- [ ] [DL4006](https://github.com/hadolint/hadolint/wiki/DL4006): Set the SHELL option -o pipefail before RUN with a pipe in it - #44 at https://github.com/dogecoin/docker/blob/dc0a034a59dc3eb76ccaeb67956d080819bc90e1/1.14.5/bullseye/Dockerfile#L37
- [ ] [SC2038](https://github.com/koalaman/shellcheck/wiki/SC2038): Use -print0/-0 or -exec + to allow for non-alphanumeric filenames. - #44 at https://github.com/dogecoin/docker/blob/dc0a034a59dc3eb76ccaeb67956d080819bc90e1/1.14.5/bullseye/Dockerfile#L40
- [ ] [DL3047](https://github.com/hadolint/hadolint/wiki/DL3047): Avoid use of wget without progress bar. - #44
- [ ] [SC2046](https://github.com/koalaman/shellcheck/wiki/SC2046): Quote this to prevent word splitting. - #44 at https://github.com/dogecoin/docker/blob/dc0a034a59dc3eb76ccaeb67956d080819bc90e1/1.14.5/bullseye/Dockerfile#L54
- [ ] [SC2035](https://github.com/koalaman/shellcheck/wiki/SC2035) : Use ./*glob* or -- *glob* so names with dashes won't become options. - #44 at https://github.com/dogecoin/docker/blob/dc0a034a59dc3eb76ccaeb67956d080819bc90e1/1.14.5/bullseye/Dockerfile#L80

Note that after fixing some items, new findings can arise. For example, after fixing DL3027 with #42, we will get the following:

- [ ] [DL3008](https://github.com/hadolint/hadolint/wiki/DL3008): Pin versions in apt get install. Instead of `apt-get install ` use `apt-get install =`

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.