FROM openshift/golang-builder:1.12 AS builder
ENV OS_GIT_MAJOR=4 OS_GIT_MINOR=3 OS_GIT_PATCH=5 OS_GIT_VERSION=4.3.5-202003020549-4a9707a OS_GIT_TREE_STATE=clean SOURCE_GIT_COMMIT=4a9707af8d6e018b652928c8141d25b5f1744123 SOURCE_GIT_TAG=4a9707a SOURCE_GIT_URL=https://github.com/openshift/baremetal-runtimecfg SOURCE_DATE_EPOCH=1579283628 OS_GIT_COMMIT=4a9707a BUILD_VERSION=v4.3.5 BUILD_RELEASE=202003020549
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/monitor/monitor.go

FROM openshift/ose-base:v4.3.5.20200302.063651
ENV OS_GIT_MAJOR=4 OS_GIT_MINOR=3 OS_GIT_PATCH=5 OS_GIT_VERSION=4.3.5-202003020549-4a9707a OS_GIT_TREE_STATE=clean SOURCE_GIT_COMMIT=4a9707af8d6e018b652928c8141d25b5f1744123 SOURCE_GIT_TAG=4a9707a SOURCE_GIT_URL=https://github.com/openshift/baremetal-runtimecfg SOURCE_DATE_EPOCH=1579283628 OS_GIT_COMMIT=4a9707a BUILD_VERSION=v4.3.5 BUILD_RELEASE=202003020549
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/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" \
        version="v4.3.5" \
        release="202003020549" \
        io.openshift.build.commit.id="4a9707af8d6e018b652928c8141d25b5f1744123" \
        io.openshift.build.source-location="https://github.com/openshift/baremetal-runtimecfg" \
        io.openshift.build.commit.url="https://github.com/openshift/baremetal-runtimecfg/commit/4a9707af8d6e018b652928c8141d25b5f1744123"

