From 989bf40f2dfa3dd952b31f5e82ef45a201370a80 Mon Sep 17 00:00:00 2001 From: Yevgeny Shnaidman Date: Sun, 7 Jun 2020 02:09:59 +0300 Subject: [PATCH] uploading our own-compiled openshift-install executable to a dedicated docker image, and using this image to build the ignition-manifets image --- Dockerfile.baremetal | 8 ++++++-- Dockerfile.installer-image | 3 +++ README.md | 11 ++++++++++- 3 files changed, 19 insertions(+), 3 deletions(-) create mode 100644 Dockerfile.installer-image diff --git a/Dockerfile.baremetal b/Dockerfile.baremetal index e9951a5..b87ce73 100644 --- a/Dockerfile.baremetal +++ b/Dockerfile.baremetal @@ -1,4 +1,7 @@ -#FROM python:2.7 +# [TODO] - remove this line, once we are ready to use openshift-installer from the release +FROM quay.io/yshnaidm/openshift-installer + + FROM fedora:31 RUN dnf install -y libvirt-libs pip python && \ yum clean all && \ @@ -13,7 +16,8 @@ ARG WORK_DIR=/data RUN mkdir $WORK_DIR RUN chmod 777 $WORK_DIR -COPY ./openshift-install $WORK_DIR +# [TODO] - change this line to use openshift-installer from the release, once we are ready +COPY --from=0 /root/installer/openshift-install $WORK_DIR COPY ./process-ignition-manifests-and-kubeconfig.py $WORK_DIR ENV WORK_DIR=$WORK_DIR diff --git a/Dockerfile.installer-image b/Dockerfile.installer-image new file mode 100644 index 0000000..15a247b --- /dev/null +++ b/Dockerfile.installer-image @@ -0,0 +1,3 @@ +FROM alpine:latest +RUN mkdir /root/installer +COPY ./openshift-install /root/installer diff --git a/README.md b/README.md index 5aae6f1..ce5be88 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ ### This is a image for generating ignition manifests & kubeconfig -1) Dockerfile - dockerfile for building the ignition-manifests-and-kubeconfig-generate image with openshift-installer platform none +1) Dockerfile (depricated) - dockerfile for building the ignition-manifests-and-kubeconfig-generate image with openshift-installer platform none 2) Dockerfile.baremetal - dockerfile for building the ignition-manifests-and-kubeconfig-generate image with openshift-installer platform baremetal 3) installer_dir/install-config.yaml - example of install-config.yaml for none platform 4) installer_dir/install-config.yaml.baremetal - example of install-config.yaml for baremetal platform. @@ -10,6 +10,15 @@ - hack/build.sh - CGO_ENABLED flag should be enable in case of baremetal platform also: - pkg/types/baremetal/validation/libvirt.go - build tag should be changed from baremetal to libvirt ( to avoid validations via libvirt) +Building: +---------------- +1) currently we use our own openshift-install executable. We save it into the containener using Dockerfile.installer-image and pushing it to a repository ( make sure ot make it public. Currently + we use quay.io/yshnaidm/openshift-installer. In case we recompile openshift-install, we need to update this image: + docker build -f Dockerfile.installer-image -t . + Example: docker build -f Dockerfile.installer-image -t quay.io/yshnaidm/openshift-installer:latest . +2) we are using the image built in step 1 to get the needed openshift-install. Once we start using openshift-install from the release, we can update Dockerfile.baremetal accordingly + docker build -f Dockerfile.baremetal . -t quay.io/ocpmetal/ignition-manifests-and-kubeconfig-generate:stable + Testing: ---------------