소스 검색

Dockerfile: build using RPM packages

This should significantly improve build time and decrease image size
Vadim Rutkovsky 6 년 전
부모
커밋
0410309335

+ 11 - 20
images/installer/Dockerfile

@@ -4,40 +4,31 @@ MAINTAINER OpenShift Team <dev@lists.openshift.redhat.com>
 
 USER root
 
-# Add origin repo for including the oc client
-COPY images/installer/origin-extra-root /
-
-# install ansible and deps
-RUN INSTALL_PKGS="python-lxml python-dns pyOpenSSL python2-cryptography openssl python2-passlib httpd-tools openssh-clients origin-clients iproute patch" \
- && yum install -y --setopt=tsflags=nodocs $INSTALL_PKGS \
- && EPEL_PKGS="ansible-2.7.8 python2-boto python2-crypto which python2-pip.noarch python2-scandir python2-packaging azure-cli-2.0.46 python2-openshift" \
- && yum install -y epel-release \
- && yum install -y --setopt=tsflags=nodocs $EPEL_PKGS \
- && if [ "$(uname -m)" == "x86_64" ]; then yum install -y https://sdodson.fedorapeople.org/google-cloud-sdk-183.0.0-3.el7.x86_64.rpm ; fi \
- && yum install -y java-1.8.0-openjdk-headless \
- && rpm -V $INSTALL_PKGS $EPEL_PKGS $EPEL_TESTING_PKGS \
- && pip install 'apache-libcloud~=2.2.1' 'SecretStorage<3' 'ansible[azure]' 'google-auth' 'boto3==1.4.6' \
- && yum clean all
-
 LABEL name="openshift/origin-ansible" \
       summary="OpenShift's installation and configuration tool" \
-      description="A containerized openshift-ansible image to let you run playbooks to install, upgrade, maintain and check an OpenShift cluster" \
+      description="A containerized openshift-ansible image to use in CI - includes necessary packages to test clusters on AWS/GCP/Azure" \
       url="https://github.com/openshift/openshift-ansible" \
       io.k8s.display-name="openshift-ansible" \
-      io.k8s.description="A containerized openshift-ansible image to let you run playbooks to install, upgrade, maintain and check an OpenShift cluster" \
+      io.k8s.description="A containerized openshift-ansible image to use in CI - includes necessary packages to test clusters on AWS/GCP/Azure" \
       io.openshift.expose-services="" \
       io.openshift.tags="openshift,install,upgrade,ansible" \
       atomic.run="once"
 
 ENV USER_UID=1001 \
-    HOME=/opt/app-root/src \
+    HOME=/opt/app-root/src/ \
     WORK_DIR=/usr/share/ansible/openshift-ansible \
     OPTS="-v"
 
 # Add image scripts and files for running as a system container
 COPY images/installer/root /
-# Include playbooks, roles, plugins, etc. from this repo
-COPY . ${WORK_DIR}
+# Add origin repo for including the oc client
+COPY images/installer/origin-extra-root /
+# Install openshift-ansible RPMs
+RUN yum install -y epel-release && \
+    yum-config-manager --enable built > /dev/null && \
+    yum install --setopt=tsflags=nodocs -y \
+      openssh-clients openshift-ansible-test origin-clients && \
+    yum clean all
 
 RUN /usr/local/bin/user_setup \
  && rm /usr/local/bin/usage.ocp

+ 0 - 41
images/installer/Dockerfile.ci

@@ -1,41 +0,0 @@
-FROM centos:7
-
-MAINTAINER OpenShift Team <dev@lists.openshift.redhat.com>
-
-USER root
-
-LABEL name="openshift/origin-ansible" \
-      summary="OpenShift's installation and configuration tool" \
-      description="A containerized openshift-ansible image to use in CI - includes necessary packages to test clusters on AWS/GCP/Azure" \
-      url="https://github.com/openshift/openshift-ansible" \
-      io.k8s.display-name="openshift-ansible" \
-      io.k8s.description="A containerized openshift-ansible image to use in CI - includes necessary packages to test clusters on AWS/GCP/Azure" \
-      io.openshift.expose-services="" \
-      io.openshift.tags="openshift,install,upgrade,ansible" \
-      atomic.run="once"
-
-ENV USER_UID=1001 \
-    HOME=/opt/app-root/src \
-    WORK_DIR=/usr/share/ansible/openshift-ansible \
-    OPTS="-v"
-
-# Add image scripts and files for running as a system container
-COPY images/installer/root /
-# Add origin repo for including the oc client
-COPY images/installer/origin-extra-root /
-# Install openshift-ansible RPMs
-RUN yum install -y epel-release && \
-    rm -rf /etc/yum.repos.d/centos-openshift-origin.repo && \
-    yum-config-manager --enable built > /dev/null && \
-    INSTALL_PKGS="openssh google-cloud-sdk azure-cli-2.0.46" \
-    yum install --setopt=tsflags=nodocs -y $INSTALL_PKGS openshift-ansible-test && \
-    yum clean all
-
-RUN /usr/local/bin/user_setup \
- && rm /usr/local/bin/usage.ocp
-
-USER ${USER_UID}
-
-WORKDIR ${WORK_DIR}
-ENTRYPOINT [ "/usr/local/bin/entrypoint" ]
-CMD [ "/usr/local/bin/run" ]

+ 0 - 6
images/installer/origin-extra-root/etc/yum.repos.d/azure-cli.repo

@@ -1,6 +0,0 @@
-[azure-cli]
-name=Azure CLI
-baseurl=https://packages.microsoft.com/yumrepos/azure-cli
-enabled=1
-gpgcheck=1
-gpgkey=https://packages.microsoft.com/keys/microsoft.asc

+ 0 - 7
images/installer/origin-extra-root/etc/yum.repos.d/centos-openshift-origin.repo

@@ -1,7 +0,0 @@
-
-[centos-openshift-origin]
-name=CentOS OpenShift Origin
-baseurl=http://mirror.centos.org/centos/7/paas/x86_64/openshift-origin/
-enabled=1
-gpgcheck=1
-gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-PaaS

+ 0 - 8
images/installer/origin-extra-root/etc/yum.repos.d/google-cloud-sdk.repo

@@ -1,8 +0,0 @@
-[google-cloud-sdk]
-name=google-cloud-sdk
-baseurl=https://packages.cloud.google.com/yum/repos/cloud-sdk-el7-x86_64
-enabled=1
-gpgcheck=1
-repo_gpgcheck=1
-gpgkey=https://packages.cloud.google.com/yum/doc/yum-key.gpg
-       https://packages.cloud.google.com/yum/doc/rpm-package-key.gpg

+ 6 - 0
images/installer/origin-extra-root/etc/yum.repos.d/openshift-origin-4.0-ci.repo

@@ -0,0 +1,6 @@
+
+[openshift-origin-4.0-ci]
+name=OpenShift Origin 4.0 CI packages
+baseurl=https://rpms.svc.ci.openshift.org/openshift-origin-v4.0/
+enabled=1
+gpgcheck=0