FROM openshift/golang-builder@sha256:4820580c3368f320581eb9e32cf97aeec179a86c5749753a14ed76410a293d83 AS builder
ENV __doozer=update BUILD_RELEASE=202203081809.p0.gf773f22.assembly.stream BUILD_VERSION=v4.10.0 OS_GIT_MAJOR=4 OS_GIT_MINOR=10 OS_GIT_PATCH=0 OS_GIT_TREE_STATE=clean OS_GIT_VERSION=4.10.0-202203081809.p0.gf773f22.assembly.stream SOURCE_GIT_TREE_STATE=clean 
ENV __doozer=merge OS_GIT_COMMIT=f773f22 OS_GIT_VERSION=4.10.0-202203081809.p0.gf773f22.assembly.stream-f773f22 SOURCE_DATE_EPOCH=1645024601 SOURCE_GIT_COMMIT=f773f225afb1a82b1aef29e9ff8a6db0c5ef018e SOURCE_GIT_TAG=f773f22 SOURCE_GIT_URL=https://github.com/redhat-cne/cloud-event-proxy 
ENV GO111MODULE=off
ENV CGO_ENABLED=1
ENV COMMON_GO_ARGS=-race
ENV GOOS=linux
ENV GOPATH=/go

WORKDIR /go/src/github.com/redhat-cne/cloud-event-proxy
COPY . .

RUN hack/build-go.sh

FROM openshift/ose-base:v4.10.0.20220308.182903 AS bin
ENV __doozer=update BUILD_RELEASE=202203081809.p0.gf773f22.assembly.stream BUILD_VERSION=v4.10.0 OS_GIT_MAJOR=4 OS_GIT_MINOR=10 OS_GIT_PATCH=0 OS_GIT_TREE_STATE=clean OS_GIT_VERSION=4.10.0-202203081809.p0.gf773f22.assembly.stream SOURCE_GIT_TREE_STATE=clean 
ENV __doozer=merge OS_GIT_COMMIT=f773f22 OS_GIT_VERSION=4.10.0-202203081809.p0.gf773f22.assembly.stream-f773f22 SOURCE_DATE_EPOCH=1645024601 SOURCE_GIT_COMMIT=f773f225afb1a82b1aef29e9ff8a6db0c5ef018e SOURCE_GIT_TAG=f773f22 SOURCE_GIT_URL=https://github.com/redhat-cne/cloud-event-proxy 
COPY --from=builder /go/src/github.com/redhat-cne/cloud-event-proxy/build/cloud-event-proxy /
COPY --from=builder /go/src/github.com/redhat-cne/cloud-event-proxy/plugins/*.so /plugins/


ENTRYPOINT ["./cloud-event-proxy"]

LABEL \
        io.k8s.display-name="Cloud Event Proxy" \
        io.k8s.description="This is a component of OpenShift Container Platform and provides a side car to handle cloud events." \
        io.openshift.tags="openshift" \
        maintainer="Aneesh Puttur <aputtur@redhat.com>" \
        name="openshift/ose-cloud-event-proxy" \
        com.redhat.component="cloud-event-proxy-container" \
        io.openshift.maintainer.product="OpenShift Container Platform" \
        io.openshift.maintainer.component="Cloud Native Events" \
        io.openshift.maintainer.subcomponent="Cloud Event Proxy" \
        release="202203081809.p0.gf773f22.assembly.stream" \
        io.openshift.build.commit.id="f773f225afb1a82b1aef29e9ff8a6db0c5ef018e" \
        io.openshift.build.source-location="https://github.com/redhat-cne/cloud-event-proxy" \
        io.openshift.build.commit.url="https://github.com/redhat-cne/cloud-event-proxy/commit/f773f225afb1a82b1aef29e9ff8a6db0c5ef018e" \
        version="v4.10.0"

