Incorporate sbom/provenance for docker image build/push pipeline - #3997
Open
Iznogohul wants to merge 1 commit into
Open
Incorporate sbom/provenance for docker image build/push pipeline#3997Iznogohul wants to merge 1 commit into
Iznogohul wants to merge 1 commit into
Conversation
- Transition the build process to official docker/build-push-action and metadata-action steps. - Secure the CI workflow by pinning third-party and new actions to exact commit SHAs. - Generate SBOM and max-level provenance records for each docker image push into dockerhub.
|
|
There was a problem hiding this comment.
Hey - I've left some high level feedback:
- The
imagesinput fordocker/metadata-actionuses${{ env.DOCKER_USERNAME || 'bluerobotics' }}, but GitHub expressions don’t support||directly; consider restructuring this to a supported conditional expression (e.g. using a separateenvorifblock) so the default username behavior works as intended. - In the standalone tarball step, you start three
docker buildx buildprocesses in the background all sharing the same local cache (cache-to/cache-from); this parallel use of the same cache directory can lead to race conditions or corruption, so consider serializing these builds or using distinct cache scopes/paths per platform. - Enabling
provenance: mode=maxalongside build args may unintentionally expose sensitive build-time values in the attestation, so it’s worth explicitly reviewing which build args may carry secrets and adjusting provenance mode or build arg usage to avoid leaking sensitive data.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- The `images` input for `docker/metadata-action` uses `${{ env.DOCKER_USERNAME || 'bluerobotics' }}`, but GitHub expressions don’t support `||` directly; consider restructuring this to a supported conditional expression (e.g. using a separate `env` or `if` block) so the default username behavior works as intended.
- In the standalone tarball step, you start three `docker buildx build` processes in the background all sharing the same local cache (`cache-to`/`cache-from`); this parallel use of the same cache directory can lead to race conditions or corruption, so consider serializing these builds or using distinct cache scopes/paths per platform.
- Enabling `provenance: mode=max` alongside build args may unintentionally expose sensitive build-time values in the attestation, so it’s worth explicitly reviewing which build args may carry secrets and adjusting provenance mode or build arg usage to avoid leaking sensitive data.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
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.
Description
Prior to this commit, Docker images were built manually via raw CLI commands in the workflow, and several GitHub Actions dependencies relied on mutable version tags.This PR transitions some Docker build pipeline to use official, Docker actions. Additionally, third-party and newly introduced action references have been pinned to exact commit SHAs to guarantee immutable, reproducible, and more secure CI runs.
Added
Changed
Fixed
Notes:
Check core sizeis still relevant as a step because if the current runs fails silently, in the pr is not presentBlueOS-core-docker-images-${{ env.GIT_HASH_SHORT }}as a zip,Summary by Sourcery
Modernize the Docker image build and release workflow by switching to official Docker actions for building, tagging, and pushing images, adding SBOM and provenance generation, consolidating multi-architecture core image artifacts, and hardening CI by pinning action versions.
New Features:
Bug Fixes:
Enhancements:
CI: