FROM openshift/golang-builder:rhel_8_golang_1.15 AS build
ENV __doozer=update BUILD_RELEASE=202104030128.p0 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-202104030128.p0 SOURCE_GIT_TREE_STATE=clean 
ENV __doozer=merge OS_GIT_COMMIT=7907399 OS_GIT_VERSION=4.7.0-202104030128.p0-7907399 SOURCE_DATE_EPOCH=1611333322 SOURCE_GIT_COMMIT=7907399f9f027458d9b88dd54caddab6daf6d7ae SOURCE_GIT_TAG=v1.4.1-32-g7907399 SOURCE_GIT_URL=https://github.com/kube-reporting/ghostunnel 

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

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

FROM openshift/ose-base:v4.7.0.20210403.020833
ENV __doozer=update BUILD_RELEASE=202104030128.p0 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-202104030128.p0 SOURCE_GIT_TREE_STATE=clean 
ENV __doozer=merge OS_GIT_COMMIT=7907399 OS_GIT_VERSION=4.7.0-202104030128.p0-7907399 SOURCE_DATE_EPOCH=1611333322 SOURCE_GIT_COMMIT=7907399f9f027458d9b88dd54caddab6daf6d7ae SOURCE_GIT_TAG=v1.4.1-32-g7907399 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="202104030128.p0" \
        io.openshift.build.commit.id="7907399f9f027458d9b88dd54caddab6daf6d7ae" \
        io.openshift.build.source-location="https://github.com/kube-reporting/ghostunnel" \
        io.openshift.build.commit.url="https://github.com/kube-reporting/ghostunnel/commit/7907399f9f027458d9b88dd54caddab6daf6d7ae" \
        version="v4.7.0"

