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

Add native sboms with buildkit #50

Open
deitch opened this issue Nov 16, 2023 · 0 comments
Open

Add native sboms with buildkit #50

deitch opened this issue Nov 16, 2023 · 0 comments

Comments

@deitch
Copy link

deitch commented Nov 16, 2023

We need to have SBoMs on our container images, in order to consume and compose them at a later stage for all of eve. This PR on eve does that for all of the in-eve-repo packages.

For this one, we need to do 2 things:

  1. Do our custom scanner/adder, which places a custom SBoM in the container image (already done earlier)
  2. Run the buildkit scanner with SBoM generation

For 2, it is straightforward. Taking one sample branch Makefile.eve, we already build with docker:

kernel-build-%: sbom Makefile.eve
	@echo "Building kernel version $(BRANCH):$(VERSION)-$* with compiler $*"
	docker buildx build \
	--build-arg="SOURCE_DATE_EPOCH=$(SOURCE_DATE_EPOCH)" \
	--build-arg="KBUILD_BUILD_TIMESTAMP=$(KBUILD_BUILD_TIMESTAMP)" \
	--build-arg="LOCALVERSION=$(VERSION)$(DIRTY)" \
	--platform $(PLATFORM) -t lfedge/eve-kernel:$(BRANCH)-$(VERSION)$(DIRTY)-$* --load -f Dockerfile.$* .

For this to work. we need to ensure we are running at least buildkit v0.11 (actual GA, not an -rc version), and add the flag --sbom=true to the image build.

That should do it. Once it is in place, you can check that it is there, see the blog post

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

No branches or pull requests

1 participant