diff --git a/Dockerfile.openshift b/Dockerfile.openshift index 5781a61517..0a697a6f61 100644 --- a/Dockerfile.openshift +++ b/Dockerfile.openshift @@ -1,13 +1,10 @@ -FROM openshift/origin-release:golang-1.10 -COPY . /go/src/github.com/kubernetes-csi/external-provisioner/ -RUN cd /go/src/github.com/kubernetes-csi/external-provisioner/ && \ - go build ./cmd/csi-provisioner - -FROM centos:7 - -COPY --from=0 /go/src/github.com/kubernetes-csi/external-provisioner/csi-provisioner /usr/bin/ +FROM registry.svc.ci.openshift.org/openshift/release:golang-1.10 AS builder +WORKDIR /go/src/github.com/kubernetes-csi/external-provisioner +COPY . . +RUN go build ./cmd/csi-provisioner +FROM registry.svc.ci.openshift.org/openshift/origin-v4.0:base +COPY --from=builder /go/src/github.com/kubernetes-csi/external-provisioner/csi-provisioner /usr/bin/ RUN useradd csi-provisioner USER csi-provisioner - ENTRYPOINT ["/usr/bin/csi-provisioner"] diff --git a/Dockerfile.openshift.rhel7 b/Dockerfile.openshift.rhel7 new file mode 100644 index 0000000000..65e0035c53 --- /dev/null +++ b/Dockerfile.openshift.rhel7 @@ -0,0 +1,10 @@ +FROM registry.svc.ci.openshift.org/ocp/builder:golang-1.10 AS builder +WORKDIR /go/src/github.com/kubernetes-csi/external-provisioner +COPY . . +RUN go build ./cmd/csi-provisioner + +FROM registry.svc.ci.openshift.org/ocp/4.0:base +COPY --from=builder /go/src/github.com/kubernetes-csi/external-provisioner/csi-provisioner /usr/bin/ +RUN useradd csi-provisioner +USER csi-provisioner +ENTRYPOINT ["/usr/bin/csi-provisioner"]