Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions images/installer/Dockerfile.rhel7
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# It builds an image containing only the openshift-install and terraform binaries.

FROM rhel7:latest as builder

USER root
ENV GOPATH="/go"
ENV PATH="$PATH:$GOPATH/bin:/usr/local/go/bin"
ENV INSTALLERDIR="$GOPATH/src/github.com/openshift/installer"
ENV GOVERSION="1.10"

# Packages and binaries requisites
RUN yum-config-manager --enable rhel-7-server-devtools-rpms && \
yum install gcc-c++ git go-toolset-${GOVERSION}-golang-bin -y && \
yum clean all

# Clone the repo
RUN mkdir -p $GOPATH/{src,bin,pkg} && \
mkdir -p $GOPATH/src/github.com/openshift/ && \
git clone https://github.com/openshift/installer.git $INSTALLERDIR

# Terraform
RUN cd $INSTALLERDIR && \
hack/get-terraform.sh && \
mv $INSTALLERDIR/bin/terraform /bin/terraform

# OpenShift installer
RUN cd $INSTALLERDIR && \
scl enable go-toolset-1.10 hack/build.sh && \
mv $INSTALLERDIR/bin/openshift-install /bin/openshift-install && \
chmod a+x /bin/openshift-install


FROM rhel7-minimal:latest
COPY --from=builder /bin/terraform /bin/openshift-install /bin/
RUN mkdir /output && chown 1000:1000 /output
USER 1000:1000
ENV PATH /bin
ENV HOME /output
WORKDIR /output
ENTRYPOINT ["/bin/openshift-install"]