From 97482d5c8e03874dda28a4273596bc7bfd7a2c45 Mon Sep 17 00:00:00 2001 From: Abhinav Dahiya Date: Thu, 13 Dec 2018 14:55:40 -0800 Subject: [PATCH] image: Add a RHEL7 dockerfile and standarize format This is similar to various PRs opened in openshift repos like https://github.com/openshift/machine-config-operator/pull/165 to help standarize the dockerfiles also remove the `COPY --from builder ` instructions that were missed in aff2e983f9438717dec2d182799ba7250035912d --- images/installer/Dockerfile.ci | 9 ++++----- images/installer/Dockerfile.ci.rhel7 | 17 +++++++++++++++++ images/nested-libvirt/Dockerfile | 1 - 3 files changed, 21 insertions(+), 6 deletions(-) create mode 100644 images/installer/Dockerfile.ci.rhel7 diff --git a/images/installer/Dockerfile.ci b/images/installer/Dockerfile.ci index 5f71941e15..e4b4b7180c 100644 --- a/images/installer/Dockerfile.ci +++ b/images/installer/Dockerfile.ci @@ -1,15 +1,14 @@ # This Dockerfile is a used by CI to publish openshift/origin-v4.0:installer -# It builds an image containing only the openshift-install and terraform binaries. +# It builds an image containing only the openshift-install. -FROM openshift/origin-release:golang-1.10 AS build +FROM registry.svc.ci.openshift.org/openshift/release:golang-1.10 AS builder WORKDIR /go/src/github.com/openshift/installer COPY . . RUN hack/build.sh -FROM centos:7 -COPY --from=build /go/src/github.com/openshift/installer/bin/openshift-install /bin/openshift-install -COPY --from=build /go/src/github.com/openshift/installer/bin/terraform /bin/terraform +FROM registry.svc.ci.openshift.org/openshift/origin-v4.0:base +COPY --from=builder /go/src/github.com/openshift/installer/bin/openshift-install /bin/openshift-install RUN mkdir /output && chown 1000:1000 /output USER 1000:1000 ENV PATH /bin diff --git a/images/installer/Dockerfile.ci.rhel7 b/images/installer/Dockerfile.ci.rhel7 new file mode 100644 index 0000000000..0b1f6d3140 --- /dev/null +++ b/images/installer/Dockerfile.ci.rhel7 @@ -0,0 +1,17 @@ +# This Dockerfile is a used by CI to publish openshift/origin-v4.0:installer +# It builds an image containing only the openshift-install. + +FROM registry.svc.ci.openshift.org/ocp/builder:golang-1.10 AS builder +WORKDIR /go/src/github.com/openshift/installer +COPY . . +RUN hack/build.sh + + +FROM registry.svc.ci.openshift.org/ocp/4.0:base +COPY --from=builder /go/src/github.com/openshift/installer/bin/openshift-install /bin/openshift-install +RUN mkdir /output && chown 1000:1000 /output +USER 1000:1000 +ENV PATH /bin +ENV HOME /output +WORKDIR /output +ENTRYPOINT ["/bin/openshift-install"] diff --git a/images/nested-libvirt/Dockerfile b/images/nested-libvirt/Dockerfile index 7cbac7c1a0..ae3839186d 100644 --- a/images/nested-libvirt/Dockerfile +++ b/images/nested-libvirt/Dockerfile @@ -7,7 +7,6 @@ RUN hack/build.sh FROM centos:7 COPY --from=build /go/src/github.com/openshift/installer/bin/openshift-install /bin/openshift-install -COPY --from=build /go/src/github.com/openshift/installer/bin/terraform /bin/terraform COPY --from=build /go/src/github.com/openshift/installer/images/nested-libvirt/google-cloud-sdk.repo /etc/yum.repos.d/google-cloud-sdk.repo COPY --from=build /go/src/github.com/openshift/installer/images/nested-libvirt/mock-nss.sh /bin/mock-nss.sh