|
| 1 | +# Per-arch digests are managed by the Konflux nudge mechanism. |
| 2 | +# Replace placeholders with actual per-arch digests before first build. |
| 3 | +FROM --platform=linux/amd64 quay.io/redhat-user-workloads/rhtap-contract-tenant/ec-v08/cli-v08@sha256:REPLACE_AMD64 AS build-amd64 |
| 4 | +FROM --platform=linux/arm64 quay.io/redhat-user-workloads/rhtap-contract-tenant/ec-v08/cli-v08@sha256:REPLACE_ARM64 AS build-arm64 |
| 5 | +FROM --platform=linux/ppc64le quay.io/redhat-user-workloads/rhtap-contract-tenant/ec-v08/cli-v08@sha256:REPLACE_PPC64LE AS build-ppc64le |
| 6 | +FROM --platform=linux/s390x quay.io/redhat-user-workloads/rhtap-contract-tenant/ec-v08/cli-v08@sha256:REPLACE_S390X AS build-s390x |
| 7 | + |
| 8 | +FROM registry.redhat.io/ubi9/go-toolset:9.7@sha256:799cc027d5ad58cdc156b65286eb6389993ec14c496cf748c09834b7251e78dc AS packager |
| 9 | +USER root |
| 10 | +RUN mkdir -p /binaries |
| 11 | + |
| 12 | +# Native Linux binaries from each arch variant |
| 13 | +COPY --from=build-amd64 /usr/local/bin/ec_linux_amd64.gz /tmp/ec_linux_amd64.gz |
| 14 | +RUN gzip -d /tmp/ec_linux_amd64.gz && \ |
| 15 | + tar -czf /binaries/ec_linux_amd64.tar.gz -C /tmp ec_linux_amd64 && \ |
| 16 | + rm /tmp/ec_linux_amd64 |
| 17 | + |
| 18 | +COPY --from=build-arm64 /usr/local/bin/ec_linux_arm64.gz /tmp/ec_linux_arm64.gz |
| 19 | +RUN gzip -d /tmp/ec_linux_arm64.gz && \ |
| 20 | + tar -czf /binaries/ec_linux_arm64.tar.gz -C /tmp ec_linux_arm64 && \ |
| 21 | + rm /tmp/ec_linux_arm64 |
| 22 | + |
| 23 | +COPY --from=build-ppc64le /usr/local/bin/ec_linux_ppc64le.gz /tmp/ec_linux_ppc64le.gz |
| 24 | +RUN gzip -d /tmp/ec_linux_ppc64le.gz && \ |
| 25 | + tar -czf /binaries/ec_linux_ppc64le.tar.gz -C /tmp ec_linux_ppc64le && \ |
| 26 | + rm /tmp/ec_linux_ppc64le |
| 27 | + |
| 28 | +COPY --from=build-s390x /usr/local/bin/ec_linux_s390x.gz /tmp/ec_linux_s390x.gz |
| 29 | +RUN gzip -d /tmp/ec_linux_s390x.gz && \ |
| 30 | + tar -czf /binaries/ec_linux_s390x.tar.gz -C /tmp ec_linux_s390x && \ |
| 31 | + rm /tmp/ec_linux_s390x |
| 32 | + |
| 33 | +# Cross-compiled binaries (same across all variants, taken from amd64) |
| 34 | +# Darwin amd64 |
| 35 | +COPY --from=build-amd64 /usr/local/bin/ec_darwin_amd64.gz /tmp/ec_darwin_amd64.gz |
| 36 | +RUN gzip -d /tmp/ec_darwin_amd64.gz && \ |
| 37 | + tar -czf /binaries/ec_darwin_amd64.tar.gz -C /tmp ec_darwin_amd64 && \ |
| 38 | + rm /tmp/ec_darwin_amd64 |
| 39 | + |
| 40 | +# Darwin arm64 |
| 41 | +COPY --from=build-amd64 /usr/local/bin/ec_darwin_arm64.gz /tmp/ec_darwin_arm64.gz |
| 42 | +RUN gzip -d /tmp/ec_darwin_arm64.gz && \ |
| 43 | + tar -czf /binaries/ec_darwin_arm64.tar.gz -C /tmp ec_darwin_arm64 && \ |
| 44 | + rm /tmp/ec_darwin_arm64 |
| 45 | + |
| 46 | +# Windows amd64 |
| 47 | +COPY --from=build-amd64 /usr/local/bin/ec_windows_amd64.exe.gz /tmp/ec_windows_amd64.exe.gz |
| 48 | +RUN gzip -d /tmp/ec_windows_amd64.exe.gz && \ |
| 49 | + tar -czf /binaries/ec_windows_amd64.tar.gz -C /tmp ec_windows_amd64.exe && \ |
| 50 | + rm /tmp/ec_windows_amd64.exe |
| 51 | + |
| 52 | +# Final minimal image with all binaries |
| 53 | +FROM registry.redhat.io/ubi9/ubi-minimal@sha256:69f5c9886ecb19b23e88275a5cd904c47dd982dfa370fbbd0c356d7b1047ef68 |
| 54 | + |
| 55 | +LABEL description="Flat image containing Conforma CLI binaries for all platforms and architectures" |
| 56 | +LABEL io.k8s.description="Flat image containing Conforma CLI binaries for all platforms and architectures" |
| 57 | +LABEL io.opencontainers.image.description="Flat image containing Conforma CLI binaries for all platforms and architectures" |
| 58 | +LABEL io.k8s.display-name="Conforma CLI stack image for Red Hat Trusted Artifact Signer" |
| 59 | +LABEL io.openshift.tags="conforma trusted-artifact-signer cli-stack" |
| 60 | +LABEL summary="Provides Conforma CLI binaries as tar.gz archives for CDN distribution." |
| 61 | +LABEL com.redhat.component="conforma-cli-stack" |
| 62 | + |
| 63 | +COPY --from=packager /binaries/ /binaries/ |
| 64 | +COPY --from=build-amd64 /licenses/ /licenses/ |
| 65 | + |
| 66 | +RUN chown -R root:0 /binaries && chmod -R g+r /binaries |
| 67 | + |
| 68 | +USER 65532:65532 |
0 commit comments