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

refactor: Lint all docker files with Hadolint #193

Merged
merged 12 commits into from
Sep 14, 2023
Merged

Conversation

amolenaar
Copy link
Contributor

@amolenaar amolenaar commented Aug 29, 2023

Update dockerfiles to adhere to the (almost) default rule set of Hadolint.

I lowered the severity level of the following rules, since they would result in a change in the behabior of the dockerfiles.

See #150. This adds Hadolint.

Initially I added hadolint as a pipeline step, however, I think it's way more effective as a pre-commit hook.

In order to function as a gate, I moved the pre-commit job in front og the build-and-deploy job.

NB. This PR remains in building state, since the pre-commit job has been merged with the build job.

May conflict with #119.

@amolenaar amolenaar marked this pull request as draft August 29, 2023 15:10
@amolenaar amolenaar force-pushed the hadolint-scanner branch 2 times, most recently from 22de589 to c830ff8 Compare August 29, 2023 16:06
@amolenaar amolenaar marked this pull request as ready for review August 29, 2023 16:06
@amolenaar amolenaar requested a review from dominik003 August 29, 2023 16:06
@amolenaar amolenaar force-pushed the hadolint-scanner branch 2 times, most recently from 7b5cd57 to 4e4b329 Compare August 30, 2023 09:05
Copy link
Contributor

@dominik003 dominik003 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice addition to our pre-commit here! It might make sense to close #119 as there is a clear rational behind having it and it doesn't hurt to have it (see DL4006).
In addition, I added one comment about moving the pre-commit job back to a separate file and use on together with workflow_run to create the dependency.

.github/workflows/deploy-docker-images.yml Outdated Show resolved Hide resolved
.pre-commit-config.yaml Outdated Show resolved Hide resolved
.pre-commit-config.yaml Outdated Show resolved Hide resolved
t4c/Dockerfile Outdated Show resolved Hide resolved
@amolenaar
Copy link
Contributor Author

All Dockerfiles now define a non-root user at the end (where needed).

@amolenaar amolenaar enabled auto-merge September 14, 2023 09:55
@amolenaar amolenaar disabled auto-merge September 14, 2023 09:55
@MoritzWeber0 MoritzWeber0 merged commit bef8329 into main Sep 14, 2023
18 checks passed
@MoritzWeber0 MoritzWeber0 deleted the hadolint-scanner branch September 14, 2023 11:59
@MoritzWeber0 MoritzWeber0 changed the title Lint all docker files with Hadolint refactor: Lint all docker files with Hadolint Sep 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants