FROM openshift/golang-builder@sha256:21aab8ec0f5d119e4f6dab12f7ad6a1cec15d5f9071ae0c7431be760f29d4c71 AS builder
ENV __doozer=update BUILD_RELEASE=202203081819.p0.g16d6c33.assembly.stream BUILD_VERSION=v4.9.0 OS_GIT_MAJOR=4 OS_GIT_MINOR=9 OS_GIT_PATCH=0 OS_GIT_TREE_STATE=clean OS_GIT_VERSION=4.9.0-202203081819.p0.g16d6c33.assembly.stream SOURCE_GIT_TREE_STATE=clean 
ENV __doozer=merge OS_GIT_COMMIT=16d6c33 OS_GIT_VERSION=4.9.0-202203081819.p0.g16d6c33.assembly.stream-16d6c33 SOURCE_DATE_EPOCH=1646221952 SOURCE_GIT_COMMIT=16d6c33ba12c055cc522b68d4f96e2358fca9270 SOURCE_GIT_TAG=16d6c33b 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.9.0.20220308.190656
ENV __doozer=update BUILD_RELEASE=202203081819.p0.g16d6c33.assembly.stream BUILD_VERSION=v4.9.0 OS_GIT_MAJOR=4 OS_GIT_MINOR=9 OS_GIT_PATCH=0 OS_GIT_TREE_STATE=clean OS_GIT_VERSION=4.9.0-202203081819.p0.g16d6c33.assembly.stream SOURCE_GIT_TREE_STATE=clean 
ENV __doozer=merge OS_GIT_COMMIT=16d6c33 OS_GIT_VERSION=4.9.0-202203081819.p0.g16d6c33.assembly.stream-16d6c33 SOURCE_DATE_EPOCH=1646221952 SOURCE_GIT_COMMIT=16d6c33ba12c055cc522b68d4f96e2358fca9270 SOURCE_GIT_TAG=16d6c33b 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="202203081819.p0.g16d6c33.assembly.stream" \
        io.openshift.build.commit.id="16d6c33ba12c055cc522b68d4f96e2358fca9270" \
        io.openshift.build.source-location="https://github.com/openshift/linuxptp-daemon" \
        io.openshift.build.commit.url="https://github.com/openshift/linuxptp-daemon/commit/16d6c33ba12c055cc522b68d4f96e2358fca9270" \
        version="v4.9.0"

