USHIFT-1050: Add hadolint : Linter for Dockerfiles and Containerfiles#1642
USHIFT-1050: Add hadolint : Linter for Dockerfiles and Containerfiles#1642openshift-merge-robot merged 4 commits intoopenshift:mainfrom
Conversation
|
@chiragkyal: This pull request references USHIFT-1050 which is a valid jira issue. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
|
Enabled |
|
As expected, the CI Job failed with error Disabling the rule back. |
| @@ -1,3 +1,4 @@ | |||
| # hadolint global ignore=DL3002,DL4006,SC3037,SC2086 | |||
There was a problem hiding this comment.
DL3002 warning: Last USER should not be root
SC3037 warning: In POSIX sh, echo flags are undefined.
SC2086 info: Double quote to prevent globbing and word splitting.
DL4006 warning: Set the SHELL option -o pipefail before RUN with a pipe in it.
There was a problem hiding this comment.
I think we may want to move the first warning to the global flags and fix the other 3 in the file.
There was a problem hiding this comment.
Let's try to avoid having local suppressions.
There was a problem hiding this comment.
- DL3002 : Moved to common config
- SC3037 : replaced
echo -ewithprintfwith some formatting changes - SC2086 : Added Double quote
- DL4006: Added
SHELL ["/bin/bash", "-o", "pipefail", "-c"]Ref here
|
@chiragkyal: all tests passed! Full PR test history. Your PR dashboard. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
|
This is LGTM for me. Let's have someone else review and merge this PR. |
| repo_gpgcheck=1\n\ | ||
| gpgkey=https://packages.cloud.google.com/yum/doc/yum-key.gpg\n\ | ||
| https://packages.cloud.google.com/yum/doc/rpm-package-key.gpg' > /etc/yum.repos.d/google-cloud-sdk.repo | ||
| RUN printf '%s\n' \ |
There was a problem hiding this comment.
Does this produce the same output? It seems like we would lose the line breaks between each of the separate values?
Could we put this config file in git as a file and then copy it into the right place in the container at this step?
There was a problem hiding this comment.
TIL
$ printf "%s\n" foo bar
foo
bar
|
/lgtm |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: chiragkyal, dhellmann The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Which issue(s) this PR addresses:
Closes https://issues.redhat.com/browse/USHIFT-1050
This PR adds hadolint as a linter for Dockerfiles and Containerfiles