FROM registry.svc.ci.openshift.org/openshift/builder:rhel-8-golang-openshift-4.6
COPY . /go/src/k8s.io/cloud-provider-openstack
RUN cd /go/src/k8s.io/cloud-provider-openstack && \
    go build -o cinder-csi-plugin cmd/cinder-csi-plugin/main.go

FROM registry.svc.ci.openshift.org/openshift/4.6:base

# Get mkfs & blkid
RUN yum update -y && \
    yum install --setopt=tsflags=nodocs -y e2fsprogs xfsprogs util-linux && \
    yum clean all && rm -rf /var/cache/yum/*

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

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