FROM openshift/golang-builder:rhel_8_golang_1.15 AS builder
ENV __doozer=update BUILD_RELEASE=202101051539.p0 BUILD_VERSION=v4.6.0 OS_GIT_MAJOR=4 OS_GIT_MINOR=6 OS_GIT_PATCH=0 OS_GIT_TREE_STATE=clean OS_GIT_VERSION=4.6.0-202101051539.p0 SOURCE_GIT_TREE_STATE=clean 
ENV __doozer=merge KUBE_GIT_COMMIT=b7527cd1fb0585f87a21223719fe0c2ebcc370d9 KUBE_GIT_MAJOR=1 KUBE_GIT_MINOR=11+ KUBE_GIT_TREE_STATE=clean KUBE_GIT_VERSION=v1.11.7-beta.0.0.20181219023948-b875d52ea96d+b7527cd OS_GIT_COMMIT=b7527cd OS_GIT_VERSION=4.6.0-202101051539.p0-b7527cd SOURCE_DATE_EPOCH=1606955698 SOURCE_GIT_COMMIT=b7527cd1fb0585f87a21223719fe0c2ebcc370d9 SOURCE_GIT_TAG=b7527cd SOURCE_GIT_URL=https://github.com/openshift/linuxptp-daemon 
WORKDIR /go/src/github.com/openshift/linuxptp-daemon
COPY . .
RUN make clean && make

FROM openshift/ose-base:v4.6.0.20210105.161320
ENV __doozer=update BUILD_RELEASE=202101051539.p0 BUILD_VERSION=v4.6.0 OS_GIT_MAJOR=4 OS_GIT_MINOR=6 OS_GIT_PATCH=0 OS_GIT_TREE_STATE=clean OS_GIT_VERSION=4.6.0-202101051539.p0 SOURCE_GIT_TREE_STATE=clean 
ENV __doozer=merge KUBE_GIT_COMMIT=b7527cd1fb0585f87a21223719fe0c2ebcc370d9 KUBE_GIT_MAJOR=1 KUBE_GIT_MINOR=11+ KUBE_GIT_TREE_STATE=clean KUBE_GIT_VERSION=v1.11.7-beta.0.0.20181219023948-b875d52ea96d+b7527cd OS_GIT_COMMIT=b7527cd OS_GIT_VERSION=4.6.0-202101051539.p0-b7527cd SOURCE_DATE_EPOCH=1606955698 SOURCE_GIT_COMMIT=b7527cd1fb0585f87a21223719fe0c2ebcc370d9 SOURCE_GIT_TAG=b7527cd SOURCE_GIT_URL=https://github.com/openshift/linuxptp-daemon 
RUN yum -y update && yum --setopt=skip_missing_names_on_install=False -y install linuxptp ethtool hwdata && yum clean all
COPY --from=builder /go/src/github.com/openshift/linuxptp-daemon/bin/ptp /usr/local/bin/

CMD ["/usr/local/bin/ptp"]

LABEL \
        name="openshift/ose-ptp" \
        com.redhat.component="ose-linuxptp-daemon-container" \
        io.openshift.maintainer.product="OpenShift Container Platform" \
        io.openshift.maintainer.component="Networking" \
        io.openshift.maintainer.subcomponent="ptp" \
        release="202101051539.p0" \
        io.openshift.build.commit.id="b7527cd1fb0585f87a21223719fe0c2ebcc370d9" \
        io.openshift.build.source-location="https://github.com/openshift/linuxptp-daemon" \
        io.openshift.build.commit.url="https://github.com/openshift/linuxptp-daemon/commit/b7527cd1fb0585f87a21223719fe0c2ebcc370d9" \
        version="v4.6.0"

