|
| 1 | +# Konflux hermetic build for the kubectl-oadp download server |
| 2 | +# Dependencies are prefetched by the Konflux pipeline (Hermeto) and injected |
| 3 | +# into the build context before this Containerfile runs. |
| 4 | + |
| 5 | +FROM brew.registry.redhat.io/rh-osbs/openshift-golang-builder:rhel_9_golang_1.24 AS builder |
| 6 | + |
| 7 | +COPY . /workspace |
| 8 | +WORKDIR /workspace |
| 9 | + |
| 10 | +ENV GOEXPERIMENT=strictfipsruntime |
| 11 | + |
| 12 | +# Build release archives for all platforms |
| 13 | +RUN make release-archives && \ |
| 14 | + mkdir -p /archives && \ |
| 15 | + mv *.tar.gz *.sha256 /archives/ && \ |
| 16 | + rm -rf /root/.cache/go-build /tmp/* release-build/ |
| 17 | + |
| 18 | +# Build the download server (FIPS-compliant) |
| 19 | +RUN CGO_ENABLED=1 GOOS=linux go build -mod=mod -a -tags strictfipsruntime \ |
| 20 | + -o /workspace/bin/download-server ./cmd/downloads/ && \ |
| 21 | + go clean -cache -modcache -testcache && \ |
| 22 | + rm -rf /root/.cache/go-build /go/pkg |
| 23 | + |
| 24 | +FROM registry.redhat.io/ubi9/ubi:latest |
| 25 | + |
| 26 | +RUN dnf -y install openssl && dnf -y reinstall tzdata && dnf clean all |
| 27 | + |
| 28 | +COPY --from=builder /archives /archives |
| 29 | +COPY --from=builder /workspace/bin/download-server /usr/local/bin/download-server |
| 30 | +COPY LICENSE /licenses/ |
| 31 | + |
| 32 | +EXPOSE 8080 |
| 33 | + |
| 34 | +USER 65532:65532 |
| 35 | + |
| 36 | +ENTRYPOINT ["/usr/local/bin/download-server"] |
| 37 | + |
| 38 | +LABEL description="OADP CLI - Binary Download Server" |
| 39 | +LABEL io.k8s.description="OADP CLI - Binary Download Server" |
| 40 | +LABEL io.k8s.display-name="OADP CLI Downloads" |
| 41 | +LABEL io.openshift.tags="oadp,migration,backup" |
| 42 | +LABEL summary="Serves pre-built kubectl-oadp binaries for all platforms" |
0 commit comments