Skip to content

Commit ca66df5

Browse files
authored
Merge pull request #294 from konflux-ci/syft-install-fix
feat: Install syft from github releases
2 parents e6d1cfa + cd42673 commit ca66df5

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

Containerfile

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
FROM quay.io/konflux-ci/oras:3d83c68 AS oras
22
FROM registry.redhat.io/rhtas/cosign-rhel9:1.2.0-1744791100 AS cosign
3-
FROM registry.redhat.io/rh-syft-tech-preview/syft-rhel9@sha256:15ed82f0b5311a570ccb8ea02135d9776c6d61e545c51b256b3fc5b5db20ba67 AS syft
43
FROM registry.access.redhat.com/ubi9/python-312@sha256:e151f5a3319d75dec2a7d57241ba7bb75f1b09bc3f7092d7615ea9c5aedb114c AS builder
54

65
# Set the working directory in the container
@@ -34,6 +33,9 @@ RUN poetry install --without dev
3433
# Use Red Hat UBI 9 Python base image for the runtime
3534
FROM registry.access.redhat.com/ubi9/python-312@sha256:e151f5a3319d75dec2a7d57241ba7bb75f1b09bc3f7092d7615ea9c5aedb114c
3635

36+
ARG TARGETARCH
37+
ENV SYFT_VERSION=1.38.2
38+
3739
LABEL name="mobster" \
3840
description="A tool for generating and managing Software Bill of Materials (SBOM)" \
3941
maintainers="The Collective team"
@@ -42,16 +44,21 @@ LABEL name="mobster" \
4244
LABEL version="1.1.0"
4345
# x-release-please-end
4446

47+
4548
# Set the working directory in the container
4649
WORKDIR /app
4750

4851
# Copy installed dependencies from the builder stage
4952
COPY --from=builder /app /app
5053

54+
USER 0
55+
# hadolint ignore=DL4006
56+
RUN curl -L "https://github.com/anchore/syft/releases/download/v${SYFT_VERSION}/syft_${SYFT_VERSION}_linux_${TARGETARCH}.tar.gz" | \
57+
tar -xz -C /usr/local/bin syft
58+
5159
# Copy needed binaries for SBOM augmentation
5260
COPY --from=oras /usr/bin/oras /usr/bin/oras
5361
COPY --from=cosign /usr/local/bin/cosign /usr/bin/cosign
54-
COPY --from=syft /usr/local/bin/syft /usr/bin/syft
5562
# Copy license to the container
5663
COPY LICENSE /licenses/
5764

0 commit comments

Comments
 (0)