FROM openshift/golang-builder:rhel_8_golang_1.16 AS build
ENV __doozer=update BUILD_RELEASE=202108130208.p0.git.3f61070.assembly.stream BUILD_VERSION=v4.8.0 OS_GIT_MAJOR=4 OS_GIT_MINOR=8 OS_GIT_PATCH=0 OS_GIT_TREE_STATE=clean OS_GIT_VERSION=4.8.0-202108130208.p0.git.3f61070.assembly.stream SOURCE_GIT_TREE_STATE=clean 
ENV __doozer=merge OS_GIT_COMMIT=3f61070 OS_GIT_VERSION=4.8.0-202108130208.p0.git.3f61070.assembly.stream-3f61070 SOURCE_DATE_EPOCH=1616531362 SOURCE_GIT_COMMIT=3f6107049ac951e0455dfb46b94a1875eab936a0 SOURCE_GIT_TAG=v1.4.1-41-g3f61070 SOURCE_GIT_URL=https://github.com/kube-reporting/ghostunnel 

COPY . /go/src/github.com/square/ghostunnel

# Note(tflannag): Go 1.16 sets GO111MODULE to `on` by default now.
ENV GO111MODULE=auto

RUN CGO_ENABLED=0 go build -tags nopkcs11 -o /usr/bin/ghostunnel github.com/square/ghostunnel

FROM openshift/ose-base:v4.8.0.20210813.021751
ENV __doozer=update BUILD_RELEASE=202108130208.p0.git.3f61070.assembly.stream BUILD_VERSION=v4.8.0 OS_GIT_MAJOR=4 OS_GIT_MINOR=8 OS_GIT_PATCH=0 OS_GIT_TREE_STATE=clean OS_GIT_VERSION=4.8.0-202108130208.p0.git.3f61070.assembly.stream SOURCE_GIT_TREE_STATE=clean 
ENV __doozer=merge OS_GIT_COMMIT=3f61070 OS_GIT_VERSION=4.8.0-202108130208.p0.git.3f61070.assembly.stream-3f61070 SOURCE_DATE_EPOCH=1616531362 SOURCE_GIT_COMMIT=3f6107049ac951e0455dfb46b94a1875eab936a0 SOURCE_GIT_TAG=v1.4.1-41-g3f61070 SOURCE_GIT_URL=https://github.com/kube-reporting/ghostunnel 

COPY --from=build /usr/bin/ghostunnel /usr/bin/ghostunnel

ENTRYPOINT ["/usr/bin/ghostunnel"]

LABEL \
        io.k8s.display-name="OpenShift Ghostunnel" \
        io.k8s.description="This is an image used by the Metering Operator to install and run Ghostunnel." \
        summary="This is an image used by the Metering Operator to install and run Ghostunnel." \
        io.openshift.tags="openshift" \
        maintainer="<metering-team@redhat.com>" \
        name="openshift/ose-ghostunnel" \
        com.redhat.component="ghostunnel-container" \
        io.openshift.maintainer.product="OpenShift Container Platform" \
        io.openshift.maintainer.component="Metering Operator" \
        release="202108130208.p0.git.3f61070.assembly.stream" \
        io.openshift.build.commit.id="3f6107049ac951e0455dfb46b94a1875eab936a0" \
        io.openshift.build.source-location="https://github.com/kube-reporting/ghostunnel" \
        io.openshift.build.commit.url="https://github.com/kube-reporting/ghostunnel/commit/3f6107049ac951e0455dfb46b94a1875eab936a0" \
        version="v4.8.0"

