-
Notifications
You must be signed in to change notification settings - Fork 3.4k
build: Enforce docker build checks #40528
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
Conversation
23ff55d
to
24f3e2c
Compare
24f3e2c
to
56c5853
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks
/test |
Docker build checks are currently only being flagged on PRs by the `docker/build-push-action` action. With this PR, image builds will fail whenever there are docker build check failures. See [docker build checks](https://docs.docker.com/build/checks/). Signed-off-by: Hadrien Patte <hadrien.patte@datadoghq.com>
4a2854e
to
af05964
Compare
Signed-off-by: Cilium Imagebot <noreply@cilium.io>
@cilium/docs-structure can someone please approve the docs-builder deployment? |
@qmonnet Thanks! It looks like it needs an additionnal approval for the Update Pull Request with new image reference step (and likely a final approval on the noop workflow run for the new commit that this workflow will push to this branch 😅) |
Signed-off-by: Cilium Imagebot <noreply@cilium.io>
Yes I meant to come back here after the first deployment had run, and got distracted while working on something else 🙂 |
/test |
Docker build checks are currently only being flagged on PRs by the
docker/build-push-action
action. With this PR, image builds will fail whenever there are docker build check failures.See docker build checks.
There are two main ways to enable enforcement of docker build checks:
# check=error=true
comment at the top of each DockerfileBUILDKIT_DOCKERFILE_CHECK=error=true
build-arg in eachdocker build
commandIn general it's easier to add the build arg in the central place where image builds are configured, that way all future Dockerfiles are garanteed to be covered. However in the case of the
cilium/cilium
repository, it turns out that image builds are defined in a lot of places: indocker/build-push-action
(10 individual occurences) workflows, but also inMakefile.docker
andimages/scripts/build-image.sh
. As a result of this, it is more difficult to ensure continued coverage of all image build mechanisms, both those used locally and those used in CI. This is why I opted to add thecheck=error=true
comment in Dockerfiles instead.We can see an example of how a CI image build job now fails on check violations here:
As part of this PR, the
images/builder/Dockerfile
,contrib/backporting/Dockerfile
andcontrib/coccinelle/Dockerfile
Dockerfiles are getting updated to fix existing check failures.Please ensure your pull request adheres to the following guidelines:
description and a
Fixes: #XXX
line if the commit addresses a particularGitHub issue.
Fixes: <commit-id>
tag, thenplease add the commit author[s] as reviewer[s] to this issue.