FROM openshift/golang-builder:1.11 AS builder
ENV SOURCE_GIT_COMMIT=318faeffd87d70d6727fd4cb30da28aab7c87da3 SOURCE_DATE_EPOCH=1568991412 BUILD_VERSION=v4.2.4 SOURCE_GIT_URL=https://github.com/openshift/must-gather SOURCE_GIT_TAG=318faef BUILD_RELEASE=201911050122
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.4.20191105.012255
ENV SOURCE_GIT_COMMIT=318faeffd87d70d6727fd4cb30da28aab7c87da3 SOURCE_DATE_EPOCH=1568991412 BUILD_VERSION=v4.2.4 SOURCE_GIT_URL=https://github.com/openshift/must-gather SOURCE_GIT_TAG=318faef BUILD_RELEASE=201911050122
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 \
        com.redhat.component="ose-must-gather-container" \
        io.openshift.build.commit.url="https://github.com/openshift/must-gather/commit/318faeffd87d70d6727fd4cb30da28aab7c87da3" \
        version="v4.2.4" \
        name="openshift/ose-must-gather" \
        io.openshift.build.commit.id="318faeffd87d70d6727fd4cb30da28aab7c87da3" \
        release="201911050122" \
        io.openshift.build.source-location="https://github.com/openshift/must-gather"

