FROM openshift/golang-builder:rhel_8_golang_1.15
ENV __doozer=update BUILD_RELEASE=202111301700.p0.g6dd9c20.assembly.stream BUILD_VERSION=v4.6.0 OS_GIT_MAJOR=4 OS_GIT_MINOR=6 OS_GIT_PATCH=0 OS_GIT_TREE_STATE=clean OS_GIT_VERSION=4.6.0-202111301700.p0.g6dd9c20.assembly.stream SOURCE_GIT_TREE_STATE=clean 
ENV __doozer=merge OS_GIT_COMMIT=6dd9c20 OS_GIT_VERSION=4.6.0-202111301700.p0.g6dd9c20.assembly.stream-6dd9c20 SOURCE_DATE_EPOCH=1610609381 SOURCE_GIT_COMMIT=6dd9c20135583f65c7f8caca9ad583cf0c2281c8 SOURCE_GIT_TAG=v0.2.0-648-g6dd9c201 SOURCE_GIT_URL=https://github.com/openshift/cloud-provider-openstack 
COPY . /go/src/k8s.io/cloud-provider-openstack
RUN cd /go/src/k8s.io/cloud-provider-openstack && \
    go build -o manila-csi-plugin cmd/manila-csi-plugin/main.go

FROM openshift/ose-base:v4.6.0.20211130.171945
ENV __doozer=update BUILD_RELEASE=202111301700.p0.g6dd9c20.assembly.stream BUILD_VERSION=v4.6.0 OS_GIT_MAJOR=4 OS_GIT_MINOR=6 OS_GIT_PATCH=0 OS_GIT_TREE_STATE=clean OS_GIT_VERSION=4.6.0-202111301700.p0.g6dd9c20.assembly.stream SOURCE_GIT_TREE_STATE=clean 
ENV __doozer=merge OS_GIT_COMMIT=6dd9c20 OS_GIT_VERSION=4.6.0-202111301700.p0.g6dd9c20.assembly.stream-6dd9c20 SOURCE_DATE_EPOCH=1610609381 SOURCE_GIT_COMMIT=6dd9c20135583f65c7f8caca9ad583cf0c2281c8 SOURCE_GIT_TAG=v0.2.0-648-g6dd9c201 SOURCE_GIT_URL=https://github.com/openshift/cloud-provider-openstack 

COPY --from=0 /go/src/k8s.io/cloud-provider-openstack/manila-csi-plugin /usr/bin/

ENTRYPOINT ["/usr/bin/manila-csi-plugin"]

LABEL \
        name="openshift/ose-csi-driver-manila" \
        com.redhat.component="csi-driver-manila-container" \
        io.openshift.maintainer.product="OpenShift Container Platform" \
        io.openshift.maintainer.component="Installer" \
        io.openshift.maintainer.subcomponent="OpenShift on OpenStack" \
        release="202111301700.p0.g6dd9c20.assembly.stream" \
        io.openshift.build.commit.id="6dd9c20135583f65c7f8caca9ad583cf0c2281c8" \
        io.openshift.build.source-location="https://github.com/openshift/cloud-provider-openstack" \
        io.openshift.build.commit.url="https://github.com/openshift/cloud-provider-openstack/commit/6dd9c20135583f65c7f8caca9ad583cf0c2281c8" \
        version="v4.6.0"

