From d05e7c4bb57d4ce74ded2b593af483756d9a2463 Mon Sep 17 00:00:00 2001 From: Clayton Coleman Date: Sat, 10 Nov 2018 21:55:21 -0500 Subject: [PATCH] Add a RHEL7 dockerfile and standarize format --- Dockerfile | 23 ++++------------------- Dockerfile.rhel7 | 10 ++++++++++ 2 files changed, 14 insertions(+), 19 deletions(-) create mode 100644 Dockerfile.rhel7 diff --git a/Dockerfile b/Dockerfile index f0fcdbca3..603e8a9e5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,25 +1,10 @@ -# Reproducible builder image -FROM openshift/origin-release:golang-1.10 as builder - -# Workaround a bug in imagebuilder (some versions) where this dir will not be auto-created. -RUN mkdir -p /go/src/github.com/openshift/cluster-autoscaler-operator +FROM registry.svc.ci.openshift.org/openshift/release:golang-1.10 AS builder WORKDIR /go/src/github.com/openshift/cluster-autoscaler-operator - -# This expects that the context passed to the docker build command is -# the cluster-autoscaler-operator directory. -# e.g. docker build -t -f COPY . . - ENV NO_DOCKER=1 -ENV GOPATH=/go ENV BUILD_DEST=/go/bin/cluster-autoscaler-operator - RUN unset VERSION && make build -# Final container -FROM openshift/origin-base -RUN yum install -y ca-certificates - -COPY --from=builder /go/bin/cluster-autoscaler-operator / - -CMD ["/cluster-autoscaler-operator"] +FROM registry.svc.ci.openshift.org/openshift/origin-v4.0:base +COPY --from=builder # /go/bin/cluster-autoscaler-operator /usr/bin/ +CMD ["/usr/bin/cluster-autoscaler-operator"] diff --git a/Dockerfile.rhel7 b/Dockerfile.rhel7 new file mode 100644 index 000000000..9fc13e41d --- /dev/null +++ b/Dockerfile.rhel7 @@ -0,0 +1,10 @@ +FROM registry.svc.ci.openshift.org/ocp/builder:golang-1.10 AS builder +WORKDIR /go/src/github.com/openshift/cluster-autoscaler-operator +COPY . . +ENV NO_DOCKER=1 +ENV BUILD_DEST=/go/bin/cluster-autoscaler-operator +RUN unset VERSION && make build + +FROM registry.svc.ci.openshift.org/ocp/4.0:base +COPY --from=builder # /go/bin/cluster-autoscaler-operator /usr/bin/ +CMD ["/usr/bin/cluster-autoscaler-operator"]