include docker provenance (#13324)

* add provenance and attestations

* improve caching
This commit is contained in:
Matthias Mair authored and GitHub committed 2026-11-19 08:51:46 +11:00
1 parent 89e0d734d8
commit 78b6dd83a4
2 files changed
+13 -5

No files matched your search

+9 -1
View File
@@ -159,6 +159,7 @@ jobs:
contents: read
packages: write
id-token: write
attestations: write
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
python_version: 3.12
@@ -231,9 +232,16 @@ jobs:
platforms: linux/amd64,linux/arm64
push: true
sbom: true
provenance: false
provenance: mode=max
target: production
tags: ${{ env.docker_tags }}
build-args: |
commit_hash=${{ env.git_commit_hash }}
commit_date=${{ env.git_commit_date }}
- name: Attest build provenance (GHCR)
if: github.event_name != 'pull_request'
uses: actions/attest@1e69f48acb82d1966a394da916b4c1698aa569d6 # v4.2.2
with:
subject-name: ghcr.io/inventree/inventree
subject-digest: ${{ steps.push-docker.outputs.digest }}
push-to-registry: true
+4 -4
View File
@@ -100,10 +100,6 @@ ENTRYPOINT ["/bin/bash", "./init.sh"]
# Multi-stage build to compile project requirements
FROM inventree_base AS builder_stage
# Copy source files
COPY src ${INVENTREE_HOME}/src
COPY tasks.py ${INVENTREE_HOME}/tasks.py
# Install backend build dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \
pkg-config build-essential \
@@ -118,6 +114,10 @@ RUN pip install --user --require-hashes -r base_requirements.txt --no-cache-dir
pip cache purge && \
rm -rf /root/.cache/pip
# Copy source files
COPY src ${INVENTREE_HOME}/src
COPY tasks.py ${INVENTREE_HOME}/tasks.py
# Install frontend build dependencies
# pinned to v0.40.5
RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/1889911f0841e669de0be5bd02c737a3f1fd20fa/install.sh | bash && \