From eafcf05bfd787c2a827a0b04833befe9fd899106 Mon Sep 17 00:00:00 2001 From: Yuxiang Zhu Date: Sep 19 2018 03:27:45 +0000 Subject: CI/CD: Bump base image of Jenkins slave to fedora:28 and install oc from Fedora repo --- diff --git a/openshift/containers/jenkins-slave/Dockerfile b/openshift/containers/jenkins-slave/Dockerfile index e90e29b..8df3a7a 100644 --- a/openshift/containers/jenkins-slave/Dockerfile +++ b/openshift/containers/jenkins-slave/Dockerfile @@ -1,5 +1,5 @@ #FIXME: The Pipeline is currently using this Dockerfile to produce images. The one located at the project root is not changed in case of breaking anything. -FROM docker-registry.engineering.redhat.com/devops-automation/rad-slave-fedora-27:latest +FROM docker-registry.engineering.redhat.com/devops-automation/rad-slave-fedora-28:latest LABEL name="waiverdb-jenkins-slave" \ description="Jenkins slave for WaiverDB dev tests" \ vendor="WaiverDB Developers" \ @@ -7,31 +7,20 @@ LABEL name="waiverdb-jenkins-slave" \ USER root -# Add dependency Tini, a tiny but valid init for containers ARG TINI_VERSION=0.18.0 -# OpenShift Jenkins Pipeline (DSL) Plugin requires oc binary to be present in the PATH environment variable of all Jenkins nodes -ARG OPENSHIFT_CLIENTS_VERSION=3.10.0 -ARG OPENSHIFT_CLIENTS_COMMIT=dd10d17 RUN dnf -y install 'dnf-command(builddep)' dnf-utils git mock-core-configs tar gzip skopeo \ wget postgresql make rpmdevtools rpmlint \ python3-flake8 python3-pylint python3-pytest \ python3-sphinx python3-sphinxcontrib-httpdomain \ - && mkdir -p /usr/local/src/waiverdb \ - && TEMPDIR=$(mktemp -d) \ - # install oc - && wget -O "$TEMPDIR"/openshift-origin-client-tools.tar \ - "https://github.com/openshift/origin/releases/download/v${OPENSHIFT_CLIENTS_VERSION}/openshift-origin-client-tools-v${OPENSHIFT_CLIENTS_VERSION}-${OPENSHIFT_CLIENTS_COMMIT}-linux-64bit.tar.gz" \ - && tar -xvf "$TEMPDIR"/openshift-origin-client-tools.tar -C "$TEMPDIR" --strip-components=1 \ - && cp "$TEMPDIR"/oc /usr/local/bin/oc && chmod +rx /usr/local/bin/oc \ - # install tini + origin-clients \ + # install tini, a tiny but valid init for containers && wget -O /usr/local/bin/tini "https://github.com/krallin/tini/releases/download/v${TINI_VERSION}/tini" \ && chmod +rx /usr/local/bin/tini \ # install wait-for-it.sh, to allow containers to wait for other services to come up && wget -O /usr/local/bin/wait-for-it "https://raw.githubusercontent.com/vishnubob/wait-for-it/master/wait-for-it.sh" \ && chmod +rx /usr/local/bin/tini /usr/local/bin/wait-for-it \ # clean up - && rm -rf "$TEMPDIR" \ && dnf clean all # install build dependencies for WaiverDB @@ -39,8 +28,7 @@ COPY waiverdb.spec /usr/local/src/waiverdb/waiverdb.spec RUN cd /usr/local/src/waiverdb \ && dnf -y builddep waiverdb.spec \ && dnf clean all \ - && chgrp -R root /usr/local/src/waiverdb \ - && chmod -R g+rwX /usr/local/src/waiverdb + && cd / && rm -rf /usr/local/src/waiverdb WORKDIR /var/lib/jenkins/ ENTRYPOINT ["/usr/local/bin/tini", "--", "jenkins-slave"] USER 1000