FROM openshift/golang-builder:1.11 AS builder
ENV __doozer=update BUILD_RELEASE=202005050921 BUILD_VERSION=v4.2.32 OS_GIT_MAJOR=4 OS_GIT_MINOR=2 OS_GIT_PATCH=32 OS_GIT_TREE_STATE=clean OS_GIT_VERSION=4.2.32-202005050921 
ENV __doozer=merge OS_GIT_COMMIT=318faef OS_GIT_VERSION=4.2.32-202005050921-318faef SOURCE_DATE_EPOCH=1568991412 SOURCE_GIT_COMMIT=318faeffd87d70d6727fd4cb30da28aab7c87da3 SOURCE_GIT_TAG=318faef SOURCE_GIT_URL=https://github.com/openshift/must-gather 
WORKDIR /go/src/github.com/openshift/must-gather
COPY . .
ENV GO_PACKAGE github.com/openshift/must-gather
RUN go build -ldflags "-X $GO_PACKAGE/pkg/version.versionFromGit=$(git describe --long --tags --abbrev=7 --match 'v[0-9]*')" ./cmd/openshift-must-gather

FROM openshift/ose-cli:v4.2.32.20200505.092140
ENV __doozer=update BUILD_RELEASE=202005050921 BUILD_VERSION=v4.2.32 OS_GIT_MAJOR=4 OS_GIT_MINOR=2 OS_GIT_PATCH=32 OS_GIT_TREE_STATE=clean OS_GIT_VERSION=4.2.32-202005050921 
ENV __doozer=merge OS_GIT_COMMIT=318faef OS_GIT_VERSION=4.2.32-202005050921-318faef SOURCE_DATE_EPOCH=1568991412 SOURCE_GIT_COMMIT=318faeffd87d70d6727fd4cb30da28aab7c87da3 SOURCE_GIT_TAG=318faef SOURCE_GIT_URL=https://github.com/openshift/must-gather 
COPY --from=builder /go/src/github.com/openshift/must-gather/openshift-must-gather /usr/bin/
COPY --from=builder /go/src/github.com/openshift/must-gather/collection-scripts/* /usr/bin/

LABEL \
        name="openshift/ose-must-gather" \
        com.redhat.component="ose-must-gather-container" \
        io.openshift.maintainer.product="OpenShift Container Platform" \
        version="v4.2.32" \
        release="202005050921" \
        io.openshift.build.commit.id="318faeffd87d70d6727fd4cb30da28aab7c87da3" \
        io.openshift.build.source-location="https://github.com/openshift/must-gather" \
        io.openshift.build.commit.url="https://github.com/openshift/must-gather/commit/318faeffd87d70d6727fd4cb30da28aab7c87da3"

