FROM registry-proxy.engineering.redhat.com/rh-osbs/openshift-golang-builder:v1.15.14-202107291503.el8.git.1794691 AS builder
ENV __doozer=update BUILD_RELEASE=202109090612.p0.git.70c7f85.assembly.4.7.30 BUILD_VERSION=v4.7.0 OS_GIT_MAJOR=4 OS_GIT_MINOR=7 OS_GIT_PATCH=0 OS_GIT_TREE_STATE=clean OS_GIT_VERSION=4.7.0-202109090612.p0.git.70c7f85.assembly.4.7.30 SOURCE_GIT_TREE_STATE=clean 
ENV __doozer=merge OS_GIT_COMMIT=70c7f85 OS_GIT_VERSION=4.7.0-202109090612.p0.git.70c7f85.assembly.4.7.30-70c7f85 SOURCE_DATE_EPOCH=1612431262 SOURCE_GIT_COMMIT=70c7f8542867392162556af5c2610a9c29d932e7 SOURCE_GIT_TAG=70c7f85 SOURCE_GIT_URL=https://github.com/openshift/network-tools 
WORKDIR /go/src/github.com/openshift/network-tools
COPY . .

# needed for ovnkube-trace
FROM openshift/ose-ovn-kubernetes:v4.7.0-202109032229.p0.git.45f41ff.assembly.stream AS ovnkube-trace
ENV __doozer=update BUILD_RELEASE=202109090612.p0.git.70c7f85.assembly.4.7.30 BUILD_VERSION=v4.7.0 OS_GIT_MAJOR=4 OS_GIT_MINOR=7 OS_GIT_PATCH=0 OS_GIT_TREE_STATE=clean OS_GIT_VERSION=4.7.0-202109090612.p0.git.70c7f85.assembly.4.7.30 SOURCE_GIT_TREE_STATE=clean 
ENV __doozer=merge OS_GIT_COMMIT=70c7f85 OS_GIT_VERSION=4.7.0-202109090612.p0.git.70c7f85.assembly.4.7.30-70c7f85 SOURCE_DATE_EPOCH=1612431262 SOURCE_GIT_COMMIT=70c7f8542867392162556af5c2610a9c29d932e7 SOURCE_GIT_TAG=70c7f85 SOURCE_GIT_URL=https://github.com/openshift/network-tools 

# tools (openshift-tools) is based off cli
FROM openshift/ose-tools:v4.7.0.20210909.061734
ENV __doozer=update BUILD_RELEASE=202109090612.p0.git.70c7f85.assembly.4.7.30 BUILD_VERSION=v4.7.0 OS_GIT_MAJOR=4 OS_GIT_MINOR=7 OS_GIT_PATCH=0 OS_GIT_TREE_STATE=clean OS_GIT_VERSION=4.7.0-202109090612.p0.git.70c7f85.assembly.4.7.30 SOURCE_GIT_TREE_STATE=clean 
ENV __doozer=merge OS_GIT_COMMIT=70c7f85 OS_GIT_VERSION=4.7.0-202109090612.p0.git.70c7f85.assembly.4.7.30-70c7f85 SOURCE_DATE_EPOCH=1612431262 SOURCE_GIT_COMMIT=70c7f8542867392162556af5c2610a9c29d932e7 SOURCE_GIT_TAG=70c7f85 SOURCE_GIT_URL=https://github.com/openshift/network-tools 
COPY --from=builder /go/src/github.com/openshift/network-tools/debug-scripts/* /usr/bin/
COPY --from=ovnkube-trace /usr/bin/ovnkube-trace /usr/bin/

# Make sure to maintain alphabetical ordering when adding new packages.
RUN INSTALL_PKGS="\
    nginx \
    numactl \
    traceroute \
    wireshark \
    " && \
    yum -y install --setopt=tsflags=nodocs --setopt=skip_missing_names_on_install=False $INSTALL_PKGS && \
    yum clean all && rm -rf /var/cache/*

LABEL \
        name="openshift/ose-network-tools" \
        com.redhat.component="ose-network-tools-container" \
        io.openshift.maintainer.product="OpenShift Container Platform" \
        io.openshift.maintainer.component="Networking" \
        release="202109090612.p0.git.70c7f85.assembly.4.7.30" \
        io.openshift.build.commit.id="70c7f8542867392162556af5c2610a9c29d932e7" \
        io.openshift.build.source-location="https://github.com/openshift/network-tools" \
        io.openshift.build.commit.url="https://github.com/openshift/network-tools/commit/70c7f8542867392162556af5c2610a9c29d932e7" \
        version="v4.7.0"

