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 a buildah task step that generates base images sbom #862

Merged
merged 4 commits into from
Apr 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions task/buildah-remote/0.1/buildah-remote.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,9 @@ spec:
fi
done

# Needed to generate base images SBOM
echo "$BASE_IMAGES" > /workspace/base_images_from_dockerfile

buildah push "$IMAGE" oci:rhtap-final-image
REMOTESSHEOF
chmod +x scripts/script-build.sh
Expand Down Expand Up @@ -434,6 +437,17 @@ spec:
securityContext:
runAsUser: 0
workingDir: $(workspaces.source.path)
- computeResources: {}
env:
- name: BASE_IMAGES_DIGESTS_PATH
value: $(results.BASE_IMAGES_DIGESTS.path)
image: quay.io/redhat-appstudio/base-images-sbom-script@sha256:667669e3def018f9dbb8eaf8868887a40bc07842221e9a98f6787edcff021840
name: create-base-images-sbom
script: |
python3 /app/base_images_sbom_script.py --sbom=sbom-cyclonedx.json --base-images-from-dockerfile=/workspace/base_images_from_dockerfile --base-images-digests=$BASE_IMAGES_DIGESTS_PATH
securityContext:
runAsUser: 0
workingDir: $(workspaces.source.path)
- computeResources: {}
image: quay.io/redhat-appstudio/buildah:v1.31.0@sha256:34f12c7b72ec2c28f1ded0c494b428df4791c909f1f174dd21b8ed6a57cf5ddb
name: inject-sbom-and-push
Expand Down
14 changes: 14 additions & 0 deletions task/buildah/0.1/buildah.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,9 @@ spec:
fi
done
# Needed to generate base images SBOM
echo "$BASE_IMAGES" > /workspace/base_images_from_dockerfile
securityContext:
capabilities:
add:
Expand Down Expand Up @@ -350,6 +353,17 @@ spec:
securityContext:
runAsUser: 0

- name: create-base-images-sbom
image: quay.io/redhat-appstudio/base-images-sbom-script@sha256:667669e3def018f9dbb8eaf8868887a40bc07842221e9a98f6787edcff021840
env:
- name: BASE_IMAGES_DIGESTS_PATH
value: $(results.BASE_IMAGES_DIGESTS.path)
script: |
python3 /app/base_images_sbom_script.py --sbom=sbom-cyclonedx.json --base-images-from-dockerfile=/workspace/base_images_from_dockerfile --base-images-digests=$BASE_IMAGES_DIGESTS_PATH
workingDir: $(workspaces.source.path)
securityContext:
runAsUser: 0

- name: inject-sbom-and-push
image: quay.io/redhat-appstudio/buildah:v1.31.0@sha256:34f12c7b72ec2c28f1ded0c494b428df4791c909f1f174dd21b8ed6a57cf5ddb
computeResources: {}
Expand Down