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