Docker build caching leading to security scan failures on streak2 - #368
Merged
Merged
Conversation
Contributor
Author
|
Updated this PR to:
This should prevent persistent cache growth and remove the known BCB findings from streak2 builds. |
joshua-white
requested review from
rrsettgast and
victorapm
and removed request for
victorapm
September 10, 2026 00:32
victorapm
reviewed
Sep 10, 2026
| run: | | ||
| image="${DOCKER_REPOSITORY}:${DOCKER_TAG}" | ||
| if docker image inspect "${image}" >/dev/null 2>&1; then | ||
| docker image rm "${image}" || echo "::warning::Failed to remove local image ${image}" |
Contributor
There was a problem hiding this comment.
If docker image rm fails for some reason, the CI job still succeeds and leaves the image behind. Should we make this a hard failure?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Even when streak2 is fully patched, security scans find vulnerable packages inside persistent Docker BuildKit cache directories. These files are created while building GEOS base and TPL Docker images. They are not necessarily present in running containers, but they remain on disk after CI finishes and are therefore detected by host-level security scans. Manual pruning removes them temporarily, but subsequent image builds recreate the cache.
The fix proposed here continues building Docker/TPL images on streak2, but using a dedicated, ephemeral Buildx builder for each CI job. The existing workflow already creates such a builder, but the build script currently uses Docker’s persistent default builder instead. The proposed change would explicitly direct builds to the temporary builder and configure it to be removed when the job finishes.
This will likely not completely fix the issue as the core problem has to do with the security scans not recognizing backported security updates because it just naively checks version numbers. This fix here should at least get rid of our huge build cache files being saved and prevent future scans failing on very old caches.