kolla/docker/kolla-toolbox/Dockerfile.j2
Jawon Choo 31259fa595 Override image's meta info.
centos based images have wrong label info,
these changes fix own image's name and build-date.

Change-Id: I1d13f8f386c8db12b5fbe5f8ecbbf9e3fbb4ba1c
Closes-Bug: #1680341
2017-05-03 11:08:17 +09:00

104 lines
3.1 KiB
Django/Jinja

FROM {{ namespace }}/{{ image_prefix }}base:{{ tag }}
LABEL maintainer="{{ maintainer }}" name="{{ image_name }}" build-date="{{ build_date }}"
{% block kolla_toolbox_header %}{% endblock %}
{% set os_client_config='/usr/lib/python2.7/site-packages/os_client_config/defaults.json' %}
{% import "macros.j2" as macros with context %}
{{ macros.configure_user(name='ansible') }}
{% if base_distro in ['centos', 'oraclelinux', 'rhel'] %}
{% set kolla_toolbox_packages = [
'crudini',
'gcc',
'gdisk',
'git',
'jq',
'libffi-devel',
'libxml2-devel',
'libxslt-devel',
'openssh-clients',
'openssl-devel',
'python-devel'
] %}
# 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 kolla_toolbox_packages = kolla_toolbox_packages + [
'MariaDB-client',
'MariaDB-devel',
'MariaDB-shared'
] %}
{% else %}
{% set kolla_toolbox_packages = kolla_toolbox_packages + [
'mariadb',
'mariadb-devel',
'mariadb-shared'
] %}
{% endif %}
{% elif base_distro in ['debian', 'ubuntu'] %}
{% set kolla_toolbox_packages = [
'build-essential',
'ca-certificates',
'crudini',
'gdisk',
'git',
'jq',
'libffi-dev',
'libmariadbclient-dev',
'libssl-dev',
'libxslt1-dev',
'mariadb-client',
'python-dev'
] %}
# Debian/stretch ships libmysqlclient.so in separate package
{% if base_distro == 'debian' %}
{% set kolla_toolbox_packages = kolla_toolbox_packages + [
'libmariadbclient-dev-compat'
] %}
{% set os_client_config='/usr/local/lib/python2.7/dist-packages/os_client_config/defaults.json' %}
{% endif %}
{% endif %}
{{ macros.install_packages(kolla_toolbox_packages | customizable("packages")) }}
{% block kolla_toolbox_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 kolla_toolbox_pip_packages = [
'ansible==2.1.1.0',
'MySQL-python',
'os-client-config==1.26.0',
'pymongo',
'pytz',
'pyudev',
'shade==1.16.0'
] %}
RUN {{ macros.install_pip(kolla_toolbox_pip_packages | customizable("pip_packages"), constraints = false) }}
RUN mkdir -p /etc/ansible /usr/share/ansible \
&& echo 'localhost ansible_connection=local' > /etc/ansible/hosts \
&& sed -i 's| "identity_api_version": "2.0",| "identity_api_version": "3",|' {{ os_client_config }}
COPY find_disks.py kolla_keystone_service.py kolla_keystone_user.py kolla_sanity.py /usr/share/ansible/
COPY ansible.cfg /var/lib/ansible/.ansible.cfg
COPY ansible_sudoers /etc/sudoers.d/kolla_ansible_sudoers
RUN chmod 440 /etc/sudoers.d/kolla_ansible_sudoers
{% block kolla_toolbox_footer %}{% endblock %}
{% block footer %}{% endblock %}
USER ansible