Skip to content
Closed
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
5 changes: 1 addition & 4 deletions .github/actions/build-docker-image/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,11 @@ inputs:
description: Labels to add to the image
output:
description: Controls what should be done with the image(s) after building
required: true
platforms:
description: The platforms for which to build the image
required: true
tags:
description: All tags for the image
required: true
target:
description: Which stage in the Dockerfile to build
required: true
Expand All @@ -35,8 +33,7 @@ runs:
context: .
file: ${{ inputs.dockerfile }}
labels: ${{ inputs.labels }}
outputs: type=${{ inputs.output }}
outputs: ${{ inputs.output }}
platforms: ${{ inputs.platforms }}
push: ${{ inputs.action == 'push' }}
tags: ${{ inputs.tags }}
target: ${{ inputs.target }}
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ runs:
dockerfile: ${{ inputs.dockerfile }}
docker-args: ${{ inputs.docker-args }}
labels: ${{ steps.metadata.outputs.labels }}
output: registry
output: type=registry
platforms: linux/amd64${{ inputs.build-arm == 'true' && ',linux/arm64' || '' }}
tags: ${{ inputs.tags || steps.metadata.outputs.tags }}
target: ${{ inputs.target }}
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/generate-attach-sbom/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ runs:
with:
dockerfile: ${{ inputs.dockerfile }}
docker-args: ${{ inputs.docker-args }}
output: docker,dest=${{ runner.temp }}/image.tar
output: type=docker,dest=${{ runner.temp }}/image.tar
platforms: ${{ inputs.platform }}
tags: ${{ inputs.tag }}
target: ${{ inputs.target }}
Expand Down
62 changes: 62 additions & 0 deletions .github/workflows/build-image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: Build image(s) on PR

on:
push:
paths:
- ci/images/**/Dockerfile.*

permissions: {}

jobs:
filter:
if: github.repository == 'CycloneDX/cdxgen'
runs-on: ubuntu-24.04
outputs:
imagefiles: ${{ steps.changed.outputs.files }}
steps:
- name: Get changed files
id: changed
uses: actions/github-script@v7
with:
script: |
const response = await github.rest.repos.compareCommits({
owner: context.repo.owner,
repo: context.repo.repo,
base: context.payload.before,
head: context.payload.after
});
const files = response.data.files
.map(f => f.filename)
.filter(f => f.includes("Dockerfile"));
core.setOutput("files", JSON.stringify(files));
image:
if: github.repository == 'CycloneDX/cdxgen'
needs: filter
strategy:
fail-fast: false
matrix:
imagefile: ${{ fromJson(needs.filter.outputs.imagefiles) }}
platform: [ amd64, arm64 ]
# Some images don't work on linux/arm64
exclude:
- imagefile: ci/images/Dockerfile.dotnet7
platform: arm64
- imagefile: ci/images/Dockerfile.dotnet8
platform: arm64
- imagefile: ci/images/Dockerfile.dotnet9
platform: arm64
- imagefile: ci/images/Dockerfile.ruby25
platform: arm64
- imagefile: ci/images/debian/Dockerfile.ruby26
platform: arm64
runs-on: ${{ matrix.platform == 'amd64' && 'ubuntu-24.04' || 'ubuntu-24.04-arm' }}
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
persist-credentials: false
- name: Build image
uses: ./.github/actions/build-docker-image
with:
dockerfile: ${{ matrix.imagefile }}
platforms: ${{ matrix.platform }}
target: cdxgen
2 changes: 1 addition & 1 deletion ci/images/Dockerfile.dotnet8
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Base-image
FROM registry.suse.com/bci/dotnet-sdk:8.0.20@sha256:255e01937ff1b7626e75ec87cf17a60b8e86437fb123f66e2c2f9c672bcd9309 AS base
FROM registry.suse.com/bci/dotnet-sdk:8.0.21@sha256:980f77d6eb57252d9d486651f22aa4674a476c5a3b2dfd35b8322fb4c008cda6 AS base

ARG GITHUB_URL=https://github.com
ARG NODEJS_DIST_URL
Expand Down