FROM openshift/golang-builder:1.13 AS builder
ENV __doozer=update BUILD_RELEASE=202007291438.p0 BUILD_VERSION=v4.4.0 OS_GIT_MAJOR=4 OS_GIT_MINOR=4 OS_GIT_PATCH=0 OS_GIT_TREE_STATE=clean OS_GIT_VERSION=4.4.0-202007291438.p0 SOURCE_GIT_TREE_STATE=clean 
ENV __doozer=merge OS_GIT_COMMIT=2ee5d62 OS_GIT_VERSION=4.4.0-202007291438.p0-2ee5d62 SOURCE_DATE_EPOCH=1591186526 SOURCE_GIT_COMMIT=2ee5d621eb5f8b94af200e63d6a4a1163eb7ac68 SOURCE_GIT_TAG=2ee5d62 SOURCE_GIT_URL=https://github.com/openshift/baremetal-runtimecfg 
WORKDIR /go/src/github.com/openshift/baremetal-runtimecfg
COPY . .
RUN GO111MODULE=on go build --mod=vendor cmd/runtimecfg/runtimecfg.go
RUN GO111MODULE=on go build --mod=vendor cmd/dynkeepalived/dynkeepalived.go
RUN GO111MODULE=on go build --mod=vendor cmd/corednsmonitor/corednsmonitor.go
RUN GO111MODULE=on go build --mod=vendor cmd/monitor/monitor.go

FROM openshift/ose-base:v4.4.0.20200729.144748
ENV __doozer=update BUILD_RELEASE=202007291438.p0 BUILD_VERSION=v4.4.0 OS_GIT_MAJOR=4 OS_GIT_MINOR=4 OS_GIT_PATCH=0 OS_GIT_TREE_STATE=clean OS_GIT_VERSION=4.4.0-202007291438.p0 SOURCE_GIT_TREE_STATE=clean 
ENV __doozer=merge OS_GIT_COMMIT=2ee5d62 OS_GIT_VERSION=4.4.0-202007291438.p0-2ee5d62 SOURCE_DATE_EPOCH=1591186526 SOURCE_GIT_COMMIT=2ee5d621eb5f8b94af200e63d6a4a1163eb7ac68 SOURCE_GIT_TAG=2ee5d62 SOURCE_GIT_URL=https://github.com/openshift/baremetal-runtimecfg 
COPY --from=builder /go/src/github.com/openshift/baremetal-runtimecfg/runtimecfg /usr/bin/
COPY --from=builder /go/src/github.com/openshift/baremetal-runtimecfg/monitor /usr/bin
COPY --from=builder /go/src/github.com/openshift/baremetal-runtimecfg/dynkeepalived /usr/bin
COPY --from=builder /go/src/github.com/openshift/baremetal-runtimecfg/corednsmonitor /usr/bin
COPY --from=builder /go/src/github.com/openshift/baremetal-runtimecfg/scripts/* /usr/bin/

ENTRYPOINT ["/usr/bin/runtimecfg"]

LABEL \
        io.k8s.display-name="baremetal-runtimecfg" \
        io.k8s.description="Retrieves Node and Cluster information for baremetal network config" \
        maintainer="Antoni Segura Puimedon <antoni@redhat.com>" \
        name="openshift/ose-baremetal-runtimecfg" \
        com.redhat.component="ose-baremetal-runtimecfg-container" \
        io.openshift.maintainer.product="OpenShift Container Platform" \
        release="202007291438.p0" \
        io.openshift.build.commit.id="2ee5d621eb5f8b94af200e63d6a4a1163eb7ac68" \
        io.openshift.build.source-location="https://github.com/openshift/baremetal-runtimecfg" \
        io.openshift.build.commit.url="https://github.com/openshift/baremetal-runtimecfg/commit/2ee5d621eb5f8b94af200e63d6a4a1163eb7ac68" \
        version="v4.4.0"

