diff --git a/Dockerfile.openshift b/Dockerfile.openshift index 44c674db..51f1d4db 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/livenessprobe/ -RUN cd /go/src/github.com/kubernetes-csi/livenessprobe/ && \ - go build -o livenessprobe ./cmd - -FROM centos:7 - -COPY --from=0 /go/src/github.com/kubernetes-csi/livenessprobe/livenessprobe /usr/bin/ +FROM registry.svc.ci.openshift.org/openshift/release:golang-1.10 AS builder +WORKDIR /go/src/github.com/kubernetes-csi/livenessprobe +COPY . . +RUN go build -o livenessprobe ./cmd +FROM registry.svc.ci.openshift.org/openshift/origin-v4.0:base +COPY --from=builder /go/src/github.com/kubernetes-csi/livenessprobe/livenessprobe /usr/bin/ RUN useradd livenessprobe USER livenessprobe - ENTRYPOINT ["/usr/bin/livenessprobe"] diff --git a/Dockerfile.openshift.rhel7 b/Dockerfile.openshift.rhel7 new file mode 100644 index 00000000..4b69dc47 --- /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/livenessprobe +COPY . . +RUN go build -o livenessprobe ./cmd + +FROM registry.svc.ci.openshift.org/ocp/4.0:base +COPY --from=builder /go/src/github.com/kubernetes-csi/livenessprobe/livenessprobe /usr/bin/ +RUN useradd livenessprobe +USER livenessprobe +ENTRYPOINT ["/usr/bin/livenessprobe"]