kolla/docker/openstack-base/Dockerfile.j2

400 lines
11 KiB
Django/Jinja

FROM {{ namespace }}/{{ image_prefix }}base:{{ tag }}
LABEL maintainer="{{ maintainer }}" name="{{ image_name }}" build-date="{{ build_date }}"
{% block openstack_base_header %}{% endblock %}
{% import "macros.j2" as macros with context %}
{% if base_distro in ['centos', 'oraclelinux', 'rhel'] %}
{% set openstack_base_packages = [
'git',
'iproute',
'openssl'
] %}
{{ macros.install_packages(openstack_base_packages) }}
{% endif %}
{% if install_type == 'binary' %}
{% if base_distro in ['centos', 'oraclelinux', 'rhel'] %}
# TODO(Allen) Remove python-dogpile-cache after the requirement of
# python-ironicclient is fixed.
{% set openstack_base_packages = [
'avahi-libs',
'cups-libs',
'fontconfig',
'fontpackages-filesystem',
'freetype',
'initscripts',
'libjpeg-turbo',
'libpng',
'libtomcrypt',
'libtommath',
'libX11',
'libX11-common',
'libXau',
'libxcb',
'libXext',
'libXi',
'libxslt',
'libyaml',
'MySQL-python',
'pyOpenSSL',
'pyparsing',
'python2-cffi',
'python2-crypto',
'python2-cryptography',
'python2-debtcollector',
'python2-eventlet',
'python2-fasteners',
'python2-funcsigs',
'python2-futurist',
'python2-greenlet',
'python2-iso8601',
'python2-msgpack',
'python2-oslo-concurrency',
'python2-oslo-config',
'python2-oslo-context',
'python2-oslo-db',
'python2-oslo-i18n',
'python2-oslo-log',
'python2-oslo-messaging',
'python2-oslo-middleware',
'python2-oslo-policy',
'python2-oslo-serialization',
'python2-oslo-service',
'python2-oslo-utils',
'python2-pika',
'python2-pika_pool',
'python2-positional',
'python2-pyasn1',
'python2-PyMySQL',
'python-alembic',
'python-amqp',
'python-anyjson',
'python-aodhclient',
'python-barbicanclient',
'python-beaker',
'python-cachetools',
'python-ceilometerclient',
'python-cliff',
'python-cloudkittyclient',
'python-cmd2',
'python-congressclient',
'python-contextlib2',
'python-dateutil',
'python-decorator',
'python-designateclient',
'python-dogpile-cache',
'python-editor',
'python-enum34',
'python-extras',
'python-fixtures',
'python-futures',
'python-glanceclient',
'python-gnocchiclient',
'python-heatclient',
'python-httplib2',
'python-idna',
'python-inotify',
'python-ipaddress',
'python-ironicclient',
'python-jsonpatch',
'python-jsonpointer',
'python-jsonschema',
'python-keyring',
'python-keystoneauth1',
'python-keystoneclient',
'python-keystonemiddleware',
'python-kombu',
'python-linecache2',
'python-lxml',
'python-magnumclient',
'python-mako',
'python-manilaclient',
'python-memcached',
'python-migrate',
'python-mimeparse',
'python-mistralclient',
'python-monotonic',
'python-muranoclient',
'python-netaddr',
'python-netifaces',
'python-neutronclient',
'python-novaclient',
'python-openstackclient',
'python-osprofiler',
'python-paste',
'python-paste-deploy',
'python-pbr',
'python-pip',
'python-ply',
'python-posix_ipc',
'python-prettytable',
'python-pycparser',
'python-PyMySQL',
'python-repoze-lru',
'python-requests',
'python-retrying',
'python-routes',
'python-saharaclient',
'python-simplejson',
'python-sqlalchemy',
'python-sqlparse',
'python-stevedore',
'python-swiftclient',
'python-tempita',
'python-testtools',
'python-traceback2',
'python-troveclient',
'python-unicodecsv',
'python-unittest2',
'python-urllib3',
'python-warlock',
'python-webob',
'python-wrapt',
'python-zaqarclient',
'PyYAML',
'systemd-sysv',
'sysvinit-tools',
'tcp_wrappers-libs'
] %}
{% if base_arch == 'x86_64' %}
{% set openstack_base_packages = openstack_base_packages + [
'Percona-Server-shared-56'
] %}
{% endif %}
{% elif base_distro in ['debian', 'ubuntu'] %}
# This will prevent questions from being asked during the install
ENV DEBIAN_FRONTEND noninteractive
{% set openstack_base_packages = [
'openssl',
'patch',
'python-aodhclient',
'python-barbicanclient',
'python-ceilometerclient',
'python-congressclient',
'python-designateclient',
'python-gnocchiclient',
'python-heatclient',
'python-ironicclient',
'python-keystoneclient',
'python-magnumclient',
'python-manilaclient',
'python-memcache',
'python-mistralclient',
'python-muranoclient',
'python-mysqldb',
'python-openstackclient',
'python-oslo.log',
'python-osprofiler',
'python-pip',
'python-pymysql',
'python-saharaclient',
'python-swiftclient',
'python-troveclient',
'python-zaqarclient'
] %}
{% endif %}
{{ macros.install_packages(openstack_base_packages | customizable("packages")) }}
{% elif install_type == 'source' %}
{% if base_distro in ['centos', 'oraclelinux', 'rhel'] %}
{% set openstack_base_packages = [
'gcc',
'gcc-c++',
'libffi-devel',
'libxml2-devel',
'libxslt-devel',
'libyaml-devel',
'openldap-devel',
'openssl-devel',
'postgresql',
'postgresql-devel',
'python-devel',
'sqlite-devel',
'zip'
] %}
# On x86-64 packages from external repos are used. lowercase names goes
# conflicts and build fails. Other architectures use standard CentOS
# packages.
{% if base_arch == 'x86_64' %}
{% set openstack_base_packages = openstack_base_packages + [
'MariaDB-devel'
] %}
{% else %}
{% set openstack_base_packages = openstack_base_packages + [
'mariadb-devel'
] %}
{% endif %}
{% elif base_distro in ['debian', 'ubuntu'] %}
{% set openstack_base_packages = [
'build-essential',
'ca-certificates',
'git',
'libffi-dev',
'libssl-dev',
'libxml2-dev',
'libxslt1-dev',
'libyaml-dev',
'libz-dev',
'pkg-config',
'python-dev',
'zip'
] %}
{% if base_arch == 'aarch64' and base_distro == 'ubuntu' %}
{% set openstack_base_packages = openstack_base_packages + [
'libmysqlclient-dev'
] %}
{% else %}
{% set openstack_base_packages = openstack_base_packages + [
'libmariadbclient-dev'
] %}
{% endif %}
# Debian/stretch ships libmysqlclient.so in separate package
{% if base_distro == 'debian' %}
{% set openstack_base_packages = openstack_base_packages + [
'libmariadbclient-dev-compat'
] %}
{% endif %}
{% endif %}
{{ macros.install_packages(openstack_base_packages | customizable("packages")) }}
{% block source_install_python_pip %}
RUN curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py \
&& python get-pip.py \
&& rm get-pip.py
{% endblock %}
{% set openstack_base_pip_packages = [
'Babel',
'Mako',
'MarkupSafe',
'Paste',
'PasteDeploy',
'PyYAML',
'Routes',
'SQLAlchemy',
'Tempita',
'WebOb',
'alembic',
'amqp',
'anyjson',
'aodhclient',
'appdirs',
'cachetools',
'cliff',
'cmd2',
'contextlib2',
'debtcollector',
'decorator',
'enum34',
'eventlet',
'fasteners',
'funcsigs',
'functools32',
'futures',
'futurist',
'gnocchiclient',
'greenlet',
'iso8601',
'jinja2',
'jsonpatch',
'jsonpointer',
'jsonschema',
'keystoneauth1',
'keystonemiddleware',
'kombu',
'monotonic',
'msgpack-python',
'MySQL-python',
'netaddr',
'netifaces',
'os-client-config',
'oslo.concurrency',
'oslo.config',
'oslo.context',
'oslo.db',
'oslo.i18n',
'oslo.log',
'oslo.messaging',
'oslo.middleware',
'oslo.policy',
'oslo.serialization',
'oslo.service',
'oslo.utils',
'oslo.vmware',
'osprofiler',
'pbr',
'pika',
'pika-pool',
'positional',
'prettytable',
'pycadf',
'pycrypto',
'pyinotify',
'pymysql',
'pyparsing',
'python-barbicanclient',
'python-ceilometerclient',
'python-cinderclient',
'python-cloudkittyclient',
'python-congressclient',
'python-dateutil',
'python-designateclient',
'python-editor',
'python-glanceclient',
'python-heatclient',
'python-ironicclient',
'python-keystoneclient',
'python-magnumclient',
'python-manilaclient',
'python-memcached',
'python-mistralclient',
'python-muranoclient',
'python-neutronclient',
'python-novaclient',
'python-openstackclient',
'python-saharaclient',
'python-swiftclient',
'python-troveclient',
'python-zaqarclient',
'pytz',
'repoze.lru',
'requests',
'requestsexceptions',
'retrying',
'simplejson',
'six',
'sqlalchemy-migrate',
'sqlparse',
'stevedore',
'unicodecsv',
'warlock',
'wrapt'
]
%}
ADD openstack-base-archive /openstack-base-source
RUN ln -s openstack-base-source/* /requirements \
&& mkdir -p /var/lib/kolla \
&& {{ macros.install_pip(['virtualenv'], constraints = false)}} \
&& virtualenv --system-site-packages /var/lib/kolla/venv
ENV PATH /var/lib/kolla/venv/bin:$PATH
RUN {{ macros.install_pip(openstack_base_pip_packages | customizable("pip_packages")) }}
{% endif %}
{% block openstack_base_footer %}{% endblock %}