FROM openshift/golang-builder:1.12 AS builder
ENV OS_GIT_MAJOR=4 OS_GIT_MINOR=2 OS_GIT_PATCH=26 OS_GIT_VERSION=4.2.26-202003230335-d22abd2 OS_GIT_TREE_STATE=clean SOURCE_GIT_COMMIT=d22abd22d1f7f227721b29f9c842c23d846021d1 SOURCE_GIT_TAG=d22abd2 SOURCE_GIT_URL=https://github.com/openshift/baremetal-runtimecfg SOURCE_DATE_EPOCH=1574944799 OS_GIT_COMMIT=d22abd2 BUILD_VERSION=v4.2.26 BUILD_RELEASE=202003230335
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.2.26.20200323.033520
ENV OS_GIT_MAJOR=4 OS_GIT_MINOR=2 OS_GIT_PATCH=26 OS_GIT_VERSION=4.2.26-202003230335-d22abd2 OS_GIT_TREE_STATE=clean SOURCE_GIT_COMMIT=d22abd22d1f7f227721b29f9c842c23d846021d1 SOURCE_GIT_TAG=d22abd2 SOURCE_GIT_URL=https://github.com/openshift/baremetal-runtimecfg SOURCE_DATE_EPOCH=1574944799 OS_GIT_COMMIT=d22abd2 BUILD_VERSION=v4.2.26 BUILD_RELEASE=202003230335
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/iptables /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.2.26" \
        release="202003230335" \
        io.openshift.build.commit.id="d22abd22d1f7f227721b29f9c842c23d846021d1" \
        io.openshift.build.source-location="https://github.com/openshift/baremetal-runtimecfg" \
        io.openshift.build.commit.url="https://github.com/openshift/baremetal-runtimecfg/commit/d22abd22d1f7f227721b29f9c842c23d846021d1"

