forked from sigstore/timestamp-authority
-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathDockerfile.cli-stack.rh
More file actions
71 lines (55 loc) · 3.83 KB
/
Copy pathDockerfile.cli-stack.rh
File metadata and controls
71 lines (55 loc) · 3.83 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
FROM registry.redhat.io/ubi9/go-toolset:9.8-1784190466@sha256:f99dd81b20e5971ef9f63a51ac27cf0aa591ff9921d021490548b67fd9b17144 AS build-cross-platform
ENV APP_ROOT=/opt/app-root \
GOPATH=/opt/app-root
USER root
WORKDIR $APP_ROOT/src
ADD go.mod go.sum ./
ADD ./ ./
RUN git config --global --add safe.directory /opt/app-root/src && \
go mod download && \
go mod edit -godebug=fips140=auto && \
make -f Build.mak cross-platform
FROM --platform=linux/amd64 quay.io/securesign/fetch-tsa-certs@sha256:fdf66dbbbfb4263db85b516998aeac5a9ee88a099942281e327cd14af0b8d4d1 AS build-amd64
FROM --platform=linux/arm64 quay.io/securesign/fetch-tsa-certs@sha256:219b0480179a6c5b54ef19a6800c91b5f2687a352221752e559bd04b8f77513e AS build-arm64
FROM --platform=linux/ppc64le quay.io/securesign/fetch-tsa-certs@sha256:168bfa4555404d39b0068761ad128beed518bf6eb4a9321cbada44db0fa6aba2 AS build-ppc64le
FROM --platform=linux/s390x quay.io/securesign/fetch-tsa-certs@sha256:f3014621a010f25d1c52581517510e91568cd2a32d00d7cf5098c60a53ce694f AS build-s390x
FROM registry.redhat.io/ubi9/go-toolset:9.8-1784190466@sha256:f99dd81b20e5971ef9f63a51ac27cf0aa591ff9921d021490548b67fd9b17144 AS packager
USER root
RUN mkdir -p /binaries
# fetch_tsa_certs: Native Linux binaries from each arch variant
COPY --from=build-amd64 /usr/local/bin/fetch_tsa_certs /tmp/fetch_tsa_certs
RUN tar -czf /binaries/fetch_tsa_certs_linux_amd64.tar.gz -C /tmp fetch_tsa_certs && \
rm /tmp/fetch_tsa_certs
COPY --from=build-arm64 /usr/local/bin/fetch_tsa_certs /tmp/fetch_tsa_certs
RUN tar -czf /binaries/fetch_tsa_certs_linux_arm64.tar.gz -C /tmp fetch_tsa_certs && \
rm /tmp/fetch_tsa_certs
COPY --from=build-ppc64le /usr/local/bin/fetch_tsa_certs /tmp/fetch_tsa_certs
RUN tar -czf /binaries/fetch_tsa_certs_linux_ppc64le.tar.gz -C /tmp fetch_tsa_certs && \
rm /tmp/fetch_tsa_certs
COPY --from=build-s390x /usr/local/bin/fetch_tsa_certs /tmp/fetch_tsa_certs
RUN tar -czf /binaries/fetch_tsa_certs_linux_s390x.tar.gz -C /tmp fetch_tsa_certs && \
rm /tmp/fetch_tsa_certs
# fetch_tsa_certs: Cross-compiled binaries
COPY --from=build-cross-platform /opt/app-root/src/fetch_tsa_certs_darwin_amd64 /tmp/fetch_tsa_certs_darwin_amd64
RUN tar -czf /binaries/fetch_tsa_certs_darwin_amd64.tar.gz -C /tmp fetch_tsa_certs_darwin_amd64 && \
rm /tmp/fetch_tsa_certs_darwin_amd64
COPY --from=build-cross-platform /opt/app-root/src/fetch_tsa_certs_darwin_arm64 /tmp/fetch_tsa_certs_darwin_arm64
RUN tar -czf /binaries/fetch_tsa_certs_darwin_arm64.tar.gz -C /tmp fetch_tsa_certs_darwin_arm64 && \
rm /tmp/fetch_tsa_certs_darwin_arm64
COPY --from=build-cross-platform /opt/app-root/src/fetch_tsa_certs_windows_amd64.exe /tmp/fetch_tsa_certs_windows_amd64.exe
RUN tar -czf /binaries/fetch_tsa_certs_windows_amd64.tar.gz -C /tmp fetch_tsa_certs_windows_amd64.exe && \
rm /tmp/fetch_tsa_certs_windows_amd64.exe
RUN chmod -R a+rX /binaries
# Final minimal image with all binaries
FROM registry.redhat.io/ubi9/ubi-micro:9.8-1782840931@sha256:35de56a9413112f1474e392ebc35e0cf6f0fb484c8e8877bbae59b513694b41f
LABEL description="Flat image containing fetch-tsa-certs CLI binaries for all platforms and architectures"
LABEL io.k8s.description="Flat image containing fetch-tsa-certs CLI binaries for all platforms and architectures"
LABEL io.opencontainers.image.description="Flat image containing fetch-tsa-certs CLI binaries for all platforms and architectures"
LABEL io.k8s.display-name="Fetch TSA certs CLI stack image for Red Hat Trusted Artifact Signer"
LABEL io.openshift.tags="fetch-tsa-certs trusted-artifact-signer cli-stack"
LABEL summary="Provides all fetch-tsa-certs CLI binaries as tar.gz archives for CDN distribution."
LABEL com.redhat.component="fetch-tsa-certs-cli-stack"
LABEL name="rhtas/fetch-tsa-certs-cli-stack"
COPY --from=packager /binaries/ /binaries/
COPY --from=build-amd64 /licenses/ /licenses/
USER 65532:65532