Kolla provides production-ready containers and deployment tools for operating OpenStack clouds
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

Dockerfile.j2 3.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. FROM {{ namespace }}/{{ image_prefix }}base:{{ tag }}
  2. LABEL maintainer="{{ maintainer }}" name="{{ image_name }}" build-date="{{ build_date }}"
  3. {% block kolla_toolbox_header %}{% endblock %}
  4. {% set virtualenv_path='/opt/ansible' %}
  5. {% set os_client_config= virtualenv_path + '/lib/python2.7/site-packages/os_client_config/defaults.json' %}
  6. {% import "macros.j2" as macros with context %}
  7. {{ macros.configure_user(name='ansible') }}
  8. {% if base_distro in ['centos', 'oraclelinux', 'rhel'] %}
  9. {% set kolla_toolbox_packages = [
  10. 'crudini',
  11. 'gcc',
  12. 'gdisk',
  13. 'git',
  14. 'jq',
  15. 'libffi-devel',
  16. 'libxml2-devel',
  17. 'libxslt-devel',
  18. 'make',
  19. 'mariadb',
  20. 'mariadb-devel',
  21. 'openssh-clients',
  22. 'openssl-devel',
  23. 'python-devel'
  24. ] %}
  25. {% elif base_distro in ['debian', 'ubuntu'] %}
  26. {% set kolla_toolbox_packages = [
  27. 'build-essential',
  28. 'ca-certificates',
  29. 'crudini',
  30. 'gdisk',
  31. 'git',
  32. 'jq',
  33. 'libffi-dev',
  34. 'libssl-dev',
  35. 'libxslt1-dev',
  36. 'mariadb-client',
  37. 'python-dev'
  38. ] %}
  39. {% if base_arch == 'aarch64' and base_distro == 'ubuntu' %}
  40. {% set kolla_toolbox_packages = kolla_toolbox_packages + [
  41. 'libmysqlclient-dev'
  42. ] %}
  43. {% else %}
  44. {% set kolla_toolbox_packages = kolla_toolbox_packages + [
  45. 'libmariadbclient-dev'
  46. ] %}
  47. {% endif %}
  48. # Debian/stretch ships libmysqlclient.so in separate package
  49. {% if base_distro == 'debian' %}
  50. {% set kolla_toolbox_packages = kolla_toolbox_packages + [
  51. 'libmariadbclient-dev-compat'
  52. ] %}
  53. {% endif %}
  54. {% endif %}
  55. {{ macros.install_packages(kolla_toolbox_packages | customizable("packages")) }}
  56. {% block kolla_toolbox_source_install_python_pip %}
  57. RUN curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py \
  58. && python get-pip.py \
  59. && rm get-pip.py
  60. {% endblock %}
  61. {% set kolla_toolbox_pip_virtualenv_packages = [
  62. 'virtualenv'
  63. ] %}
  64. RUN {{ macros.install_pip(kolla_toolbox_pip_virtualenv_packages|customizable("pip_packages"), constraints=false) }} \
  65. && virtualenv --system-site-packages {{ virtualenv_path }}
  66. ENV PATH {{ virtualenv_path }}/bin:$PATH
  67. {% set kolla_toolbox_pip_packages = [
  68. 'ansible==2.2.0.0',
  69. '"cmd2<0.9.0"',
  70. 'influxdb',
  71. 'MySQL-python',
  72. 'os-client-config==1.29.0',
  73. 'pbr==4.0.0',
  74. 'pymongo',
  75. 'python-openstackclient==3.14.0',
  76. 'pytz',
  77. 'pyudev',
  78. 'shade==1.27.1'
  79. ] %}
  80. RUN {{ macros.install_pip(kolla_toolbox_pip_packages | customizable("pip_packages"), constraints=false) }} \
  81. && mkdir -p /etc/ansible /usr/share/ansible \
  82. && echo 'localhost ansible_connection=local ansible_python_interpreter={{ virtualenv_path }}/bin/python' > /etc/ansible/hosts \
  83. && sed -i 's| "identity_api_version": "2.0",| "identity_api_version": "3",|' {{ os_client_config }}
  84. ENV ANSIBLE_LIBRARY /usr/share/ansible:$ANSIBLE_LIBRARY
  85. COPY find_disks.py kolla_keystone_service.py kolla_keystone_user.py kolla_sanity.py /usr/share/ansible/
  86. COPY ansible.cfg /var/lib/ansible/.ansible.cfg
  87. COPY ansible_sudoers /etc/sudoers.d/kolla_ansible_sudoers
  88. RUN chmod 440 /etc/sudoers.d/kolla_ansible_sudoers
  89. {% block kolla_toolbox_footer %}{% endblock %}
  90. {% block footer %}{% endblock %}
  91. USER ansible