FROM openshift/golang-builder:1.13 AS builder
ENV __doozer=update BUILD_RELEASE=202010301137.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-202010301137.p0 SOURCE_GIT_TREE_STATE=clean 
ENV __doozer=merge KUBE_GIT_COMMIT=9d3d2117150e7683dd9eb8e2b464b0a019fbd7c0 KUBE_GIT_MAJOR=1 KUBE_GIT_MINOR=11+ KUBE_GIT_TREE_STATE=clean KUBE_GIT_VERSION=v1.11.7-beta.0.0.20181219023948-b875d52ea96d+9d3d211 OS_GIT_COMMIT=9d3d211 OS_GIT_VERSION=4.4.0-202010301137.p0-9d3d211 SOURCE_DATE_EPOCH=1579732655 SOURCE_GIT_COMMIT=9d3d2117150e7683dd9eb8e2b464b0a019fbd7c0 SOURCE_GIT_TAG=9d3d211 SOURCE_GIT_URL=https://github.com/openshift/linuxptp-daemon 
ADD . /usr/src/linuxptp-daemon

WORKDIR /usr/src/linuxptp-daemon
ENV GO111MODULE=off
RUN make clean && make

FROM openshift/ose-base:v4.4.0.20201030.120944
ENV __doozer=update BUILD_RELEASE=202010301137.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-202010301137.p0 SOURCE_GIT_TREE_STATE=clean 
ENV __doozer=merge KUBE_GIT_COMMIT=9d3d2117150e7683dd9eb8e2b464b0a019fbd7c0 KUBE_GIT_MAJOR=1 KUBE_GIT_MINOR=11+ KUBE_GIT_TREE_STATE=clean KUBE_GIT_VERSION=v1.11.7-beta.0.0.20181219023948-b875d52ea96d+9d3d211 OS_GIT_COMMIT=9d3d211 OS_GIT_VERSION=4.4.0-202010301137.p0-9d3d211 SOURCE_DATE_EPOCH=1579732655 SOURCE_GIT_COMMIT=9d3d2117150e7683dd9eb8e2b464b0a019fbd7c0 SOURCE_GIT_TAG=9d3d211 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 /usr/src/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="202010301137.p0" \
        io.openshift.build.commit.id="9d3d2117150e7683dd9eb8e2b464b0a019fbd7c0" \
        io.openshift.build.source-location="https://github.com/openshift/linuxptp-daemon" \
        io.openshift.build.commit.url="https://github.com/openshift/linuxptp-daemon/commit/9d3d2117150e7683dd9eb8e2b464b0a019fbd7c0" \
        version="v4.4.0"

