2015-08-07 04:36:20 +02:00
|
|
|
FROM {{ base_distro }}:{{ base_distro_tag }}
|
|
|
|
MAINTAINER Kolla Project (https://launchpad.net/kolla)
|
|
|
|
|
2015-09-27 08:10:59 +00:00
|
|
|
# Early failure for bases and types
|
|
|
|
{% if base_distro in ['fedora', 'centos', 'oraclelinux', 'rhel'] %}
|
|
|
|
{% if install_type not in ['source', 'binary', 'rdo', 'rhel'] %}
|
|
|
|
|
|
|
|
RUN echo 'ERROR: {{ install_type }} is unavailable for {{ base_distro }}' \
|
|
|
|
&& /bin/false
|
|
|
|
|
|
|
|
{% endif %}
|
|
|
|
{% elif base_distro in ['ubuntu', 'debian'] %}
|
|
|
|
{% if install_type not in ['source'] %}
|
|
|
|
|
|
|
|
RUN echo 'ERROR: {{ install_type }} is unavailable for {{ base_distro }}' \
|
|
|
|
&& /bin/false
|
|
|
|
|
|
|
|
{% endif %}
|
|
|
|
{% else %}
|
|
|
|
|
|
|
|
RUN echo 'ERROR: The specified distro has no Kolla images to build: "{{ base_distro }}"' \
|
|
|
|
&& /bin/false
|
|
|
|
|
|
|
|
{% endif %}
|
|
|
|
|
|
|
|
|
2015-08-20 21:59:16 +02:00
|
|
|
{{ include_header }}
|
|
|
|
|
2015-08-23 03:45:03 +00:00
|
|
|
ENV KOLLA_BASE_DISTRO {{ base_distro }}
|
|
|
|
ENV KOLLA_INSTALL_TYPE {{ install_type }}
|
2015-09-17 09:35:33 -07:00
|
|
|
ENV KOLLA_INSTALL_METATYPE {{ install_metatype }}
|
2015-08-23 03:45:03 +00:00
|
|
|
|
2015-09-12 18:34:55 -07:00
|
|
|
# For RPM Variants, enable the correct repositories - this should all be done
|
|
|
|
# in the base image so repos are consistent throughout the system. This also
|
|
|
|
# enables to provide repo overrides at a later date in a simple fashion if we
|
|
|
|
# desire such functionality. I think we will :)
|
|
|
|
|
2015-09-04 03:17:00 -07:00
|
|
|
{% if base_distro in ['fedora', 'centos', 'oraclelinux', 'rhel'] %}
|
2015-08-27 20:37:59 -07:00
|
|
|
|
2015-09-12 18:34:55 -07:00
|
|
|
#### BEGIN REPO ENABLEMENT
|
|
|
|
|
|
|
|
# Turns on MariaDB repos throughout the RPM build
|
2015-08-27 20:37:59 -07:00
|
|
|
COPY mariadb.yum.repo /etc/yum.repos.d/MariaDB.repo
|
|
|
|
|
|
|
|
RUN yum install -y http://www.percona.com/redir/downloads/percona-release/redhat/0.1-3/percona-release-0.1-3.noarch.rpm \
|
|
|
|
&& sed -i 's|$releasever|centos/latest|g' /etc/yum.repos.d/percona-release.repo
|
|
|
|
|
2015-09-12 18:34:55 -07:00
|
|
|
{% if install_metatype == 'rdo' %}
|
2015-08-07 04:36:20 +02:00
|
|
|
|
|
|
|
# This repository provides all dependencies used by RDO OpenStack
|
|
|
|
RUN yum install -y https://rdoproject.org/repos/openstack-kilo/rdo-release-kilo.rpm
|
|
|
|
# This repository provides latest packages built from trunk master into RPMs
|
|
|
|
RUN curl http://trunk.rdoproject.org/centos7/current/delorean.repo -o /etc/yum.repos.d/delorean-current.repo
|
2015-09-18 15:53:31 -04:00
|
|
|
RUN curl http://trunk.rdoproject.org/centos7/delorean-deps.repo -o /etc/yum.repos.d/delorean-deps.repo
|
2015-08-07 04:36:20 +02:00
|
|
|
|
2015-09-12 18:34:55 -07:00
|
|
|
{% endif %}
|
|
|
|
# endif for repo setup for all RHEL except RHEL OSP
|
|
|
|
|
|
|
|
{% if install_metatype == 'rhos' %}
|
|
|
|
|
|
|
|
# Turn on the RHOS 7.0 repo for RHOS
|
|
|
|
RUN subscription-manager repos --enable rhel-7-server-rpms \
|
|
|
|
&& subscription-manager repos --enable rhel-7-server-openstack-7.0-rpms
|
|
|
|
|
|
|
|
{% endif %}
|
|
|
|
|
|
|
|
{% if base_distro == 'centos' %}
|
|
|
|
|
2015-08-07 04:36:20 +02:00
|
|
|
# CentOS 7.1 workaround for conflicting packages with libvirt
|
|
|
|
RUN rpm -e --nodeps systemd-container systemd-container-libs \
|
|
|
|
&& rpm -e --nodeps yum-plugin-fastestmirror \
|
|
|
|
&& yum -d 10 -y install systemd systemd-libs systemd-devel \
|
2015-09-04 03:17:00 -07:00
|
|
|
&& yum install -y epel-release \
|
2015-08-07 04:36:20 +02:00
|
|
|
&& yum clean all
|
|
|
|
|
2015-09-12 18:34:55 -07:00
|
|
|
{% endif %}
|
|
|
|
# Endif for base_distro centos
|
|
|
|
|
|
|
|
{% if base_distro == 'rhel' %}
|
|
|
|
|
|
|
|
# Enable couple required repositories for all RHEL builds
|
|
|
|
# Turn on EPEL throughout the build
|
|
|
|
RUN yum install -y \
|
|
|
|
https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm \
|
|
|
|
&& yum clean all \
|
|
|
|
&& subscription-manager repos --enable rhel-7-server-optional-rpms \
|
|
|
|
&& subscription-manager repos --enable rhel-7-server-extras-rpms
|
|
|
|
|
|
|
|
{% endif %}
|
|
|
|
# Endif for base_distro RHEL
|
|
|
|
|
|
|
|
{% if base_distro == 'oraclelinux' %}
|
|
|
|
|
2015-08-19 16:58:12 +00:00
|
|
|
RUN yum install -y \
|
|
|
|
yum-utils \
|
|
|
|
https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm \
|
|
|
|
&& yum clean all
|
|
|
|
RUN yum-config-manager --enable ol7_optional_latest ol7_addons
|
|
|
|
|
2015-09-12 18:34:55 -07:00
|
|
|
{% endif %}
|
|
|
|
# Endif for base_distro oraclelinux
|
|
|
|
|
|
|
|
{% if base_distro == 'fedora' %}
|
2015-08-07 04:36:20 +02:00
|
|
|
|
|
|
|
# Set up repositories
|
|
|
|
RUN yum install -y https://rdo.fedorapeople.org/rdo-release.rpm \
|
|
|
|
&& yum -y install dnf dnf-plugins-core \
|
2015-08-30 07:47:09 +00:00
|
|
|
&& yum clean all
|
2015-08-07 04:36:20 +02:00
|
|
|
|
2015-09-12 18:34:55 -07:00
|
|
|
{% endif %}
|
|
|
|
# Endif for base_distro fedora
|
|
|
|
|
|
|
|
#### END REPO ENABLEMENT
|
|
|
|
|
|
|
|
# We are back to the basic if conditional here which is:
|
|
|
|
# if base_distro in ['fedora', 'centos', 'oraclelinux', 'rhel']
|
2015-08-07 04:36:20 +02:00
|
|
|
|
|
|
|
RUN yum update -y \
|
|
|
|
&& yum clean all
|
|
|
|
|
2015-09-12 18:34:55 -07:00
|
|
|
{% if install_type == 'binary' %}
|
|
|
|
|
2015-08-07 04:36:20 +02:00
|
|
|
# Install base packages
|
|
|
|
RUN yum install -y \
|
2015-09-12 13:47:24 -07:00
|
|
|
sudo \
|
2015-09-12 10:11:55 -07:00
|
|
|
which \
|
2015-08-07 04:36:20 +02:00
|
|
|
&& yum clean all
|
|
|
|
|
2015-09-12 18:34:55 -07:00
|
|
|
{% endif %}
|
2015-08-07 04:36:20 +02:00
|
|
|
# Endif for install_type binary
|
2015-09-12 18:34:55 -07:00
|
|
|
|
|
|
|
{% if install_type == 'source' %}
|
2015-08-07 04:36:20 +02:00
|
|
|
|
2015-09-16 10:34:28 +03:00
|
|
|
{% if base_distro in ['centos', 'oraclelinux', 'rhel'] %}
|
|
|
|
|
|
|
|
# Set up repositories
|
|
|
|
RUN yum install -y https://rdo.fedorapeople.org/rdo-release.rpm \
|
|
|
|
&& yum clean all
|
|
|
|
|
|
|
|
{% endif %}
|
|
|
|
|
2015-08-07 04:36:20 +02:00
|
|
|
# Update packages
|
|
|
|
RUN yum update -y \
|
|
|
|
&& yum install -y \
|
|
|
|
epel-release \
|
|
|
|
gcc \
|
2015-08-16 08:15:04 -07:00
|
|
|
gcc-c++ \
|
2015-08-07 04:36:20 +02:00
|
|
|
git \
|
|
|
|
libffi-devel \
|
|
|
|
libxml2-devel \
|
|
|
|
libxslt-devel \
|
|
|
|
mariadb-devel \
|
|
|
|
mysql-devel \
|
|
|
|
openldap-devel \
|
|
|
|
openssl \
|
|
|
|
openssl-devel \
|
|
|
|
postgresql \
|
|
|
|
postgresql-devel \
|
|
|
|
python-devel \
|
|
|
|
sqlite-devel \
|
2015-09-12 13:47:24 -07:00
|
|
|
sudo \
|
2015-08-07 04:36:20 +02:00
|
|
|
tar \
|
2015-09-12 10:11:55 -07:00
|
|
|
which \
|
2015-08-07 04:36:20 +02:00
|
|
|
&& yum clean all
|
|
|
|
|
2015-09-12 18:34:55 -07:00
|
|
|
{% endif %}
|
|
|
|
# endif for install type is binary/rhos/rdo for RPM based distros
|
|
|
|
# endif for base_distro centos,fedora,oraclelinux,rhel
|
2015-08-07 04:36:20 +02:00
|
|
|
{% elif base_distro in ['ubuntu', 'debian'] %}
|
|
|
|
|
2015-08-20 14:31:22 +00:00
|
|
|
# This will prevent questions from being asked during the install
|
|
|
|
ENV DEBIAN_FRONTEND noninteractive
|
|
|
|
|
|
|
|
COPY sources.list /etc/apt/
|
|
|
|
|
|
|
|
RUN apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com 199369E5404BD5FC7D2FE43BCBCB082A1BB943DB \
|
|
|
|
&& apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com 391A9AA2147192839E9DB0315EDB1B62EC4926EA \
|
|
|
|
&& apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com 430BDF5C56E7C94E848EE60C1C4CBDCDCD2EFD2A \
|
2015-08-07 04:36:20 +02:00
|
|
|
&& apt-get update \
|
|
|
|
&& apt-get upgrade -y \
|
|
|
|
&& apt-get dist-upgrade -y \
|
2015-09-03 10:32:42 +00:00
|
|
|
&& apt-get install -y --no-install-recommends python \
|
2015-08-24 15:17:42 +00:00
|
|
|
&& apt-get clean \
|
|
|
|
&& sed -i "s|'purelib': '\$base/local/lib/python\$py_version_short/dist-packages',|'purelib': '\$base/lib/python\$py_version_short/dist-packages',|;s|'platlib': '\$platbase/local/lib/python\$py_version_short/dist-packages',|'platlib': '\$platbase/lib/python\$py_version_short/dist-packages',|;s|'headers': '\$base/local/include/python\$py_version_short/\$dist_name',|'headers': '\$base/include/python\$py_version_short/\$dist_name',|;s|'scripts': '\$base/local/bin',|'scripts': '\$base/bin',|;s|'data' : '\$base/local',|'data' : '\$base',|" /usr/lib/python2.7/distutils/command/install.py \
|
|
|
|
&& rm -rf /usr/lib/python2.7/site-packages \
|
|
|
|
&& ln -s dist-packages /usr/lib/python2.7/site-packages
|
2015-08-07 04:36:20 +02:00
|
|
|
|
|
|
|
|
|
|
|
{% endif %}
|
|
|
|
|
2015-09-30 11:23:39 +00:00
|
|
|
COPY set_configs.py /opt/kolla/
|
|
|
|
|
|
|
|
COPY start.sh /usr/local/bin/kolla_start
|
|
|
|
RUN touch /usr/local/bin/kolla_extend_start \
|
|
|
|
&& chmod 755 /usr/local/bin/kolla_start /usr/local/bin/kolla_extend_start /opt/kolla/set_configs.py
|
|
|
|
|
|
|
|
CMD ["kolla_start"]
|