|
| 1 | +# Build the manager binary |
| 2 | +FROM brew.registry.redhat.io/rh-osbs/openshift-golang-builder:rhel_9_golang_1.24 AS builder |
| 3 | + |
| 4 | +ARG GIT_COMMIT=dev |
| 5 | +ARG GIT_BRANCH=dev |
| 6 | +ARG TARGETOS |
| 7 | +ARG TARGETARCH |
| 8 | + |
| 9 | +WORKDIR $GOPATH/openperouter |
| 10 | + |
| 11 | +COPY . . |
| 12 | + |
| 13 | +RUN CGO_ENABLED=0 GOOS=${TARGETOS:-linux} GOARCH=${TARGETARCH} go build -v -mod=vendor -o reloader ./cmd/reloader \ |
| 14 | + && \ |
| 15 | + CGO_ENABLED=0 GOOS=${TARGETOS:-linux} GOARCH=${TARGETARCH} go build -v -mod=vendor -o controller ./cmd/hostcontroller \ |
| 16 | + && \ |
| 17 | + CGO_ENABLED=0 GOOS=${TARGETOS:-linux} GOARCH=${TARGETARCH} go build -v -mod=vendor -o cp-tool ./cmd/cp-tool \ |
| 18 | + && \ |
| 19 | + CGO_ENABLED=0 GOOS=${TARGETOS:-linux} GOARCH=${TARGETARCH} go build -v -mod=vendor -o nodemarker ./cmd/nodemarker \ |
| 20 | + && \ |
| 21 | + CGO_ENABLED=0 GOOS=${TARGETOS:-linux} GOARCH=${TARGETARCH} go build -v -mod=vendor -o operatorbinary ./operator |
| 22 | + |
| 23 | +FROM registry.access.redhat.com/ubi9-minimal:9.4 |
| 24 | +WORKDIR / |
| 25 | +COPY --from=builder /go/openperouter/reloader . |
| 26 | +COPY --from=builder /go/openperouter/controller . |
| 27 | +COPY --from=builder /go/openperouter/cp-tool . |
| 28 | +COPY --from=builder /go/openperouter/nodemarker . |
| 29 | +COPY --from=builder /go/openperouter/operatorbinary ./operator |
| 30 | +COPY operator/bindata bindata |
| 31 | + |
| 32 | +LABEL com.redhat.component="openperouter" \ |
| 33 | + name="openperouter" \ |
| 34 | + version="${CI_CONTAINER_VERSION}" \ |
| 35 | + summary="openperouter" \ |
| 36 | + io.openshift.expose-services="" \ |
| 37 | + io.openshift.tags="openperouter" \ |
| 38 | + io.k8s.display-name="openperouter" \ |
| 39 | + io.k8s.description="openperouter" \ |
| 40 | + description="openperouter" \ |
| 41 | + distribution-scope="public" \ |
| 42 | + release="4.20" \ |
| 43 | + url="https://github.com/openperouter/openperouter" \ |
| 44 | + vendor="Red Hat, Inc." |
| 45 | + |
| 46 | +ENTRYPOINT ["/controller"] |
0 commit comments