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 2.7KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. FROM {{ namespace }}/{{ image_prefix }}openstack-base:{{ tag }}
  2. LABEL maintainer="{{ maintainer }}" name="{{ image_name }}" build-date="{{ build_date }}"
  3. {% block cinder_base_header %}{% endblock %}
  4. {% import "macros.j2" as macros with context %}
  5. {{ macros.configure_user(name='cinder') }}
  6. {% if install_type == 'binary' %}
  7. {% if base_distro in ['centos', 'oraclelinux', 'rhel'] %}
  8. {% set cinder_base_packages = [
  9. 'ceph-common',
  10. 'lvm2',
  11. 'cryptsetup',
  12. 'openstack-cinder',
  13. 'python-automaton',
  14. 'python-oslo-vmware'
  15. ] %}
  16. {% elif base_distro in ['debian', 'ubuntu'] %}
  17. {% set cinder_base_packages = [
  18. 'ceph-common',
  19. 'cinder-common',
  20. 'lvm2',
  21. 'cryptsetup',
  22. 'python-oslo.vmware'
  23. ] %}
  24. {% endif %}
  25. {{ macros.install_packages(cinder_base_packages | customizable("packages")) }}
  26. {% elif install_type == 'source' %}
  27. {% if base_distro in ['centos', 'oraclelinux', 'rhel'] %}
  28. {% set cinder_base_packages = [
  29. 'ceph-common',
  30. 'lvm2',
  31. 'cryptsetup',
  32. ] %}
  33. {% if base_distro in ['centos', 'oraclelinux'] %}
  34. {% set cinder_base_packages = cinder_base_packages + [
  35. 'qemu-img-ev'
  36. ] %}
  37. {% else %}
  38. {% set cinder_base_packages = cinder_base_packages + [
  39. 'qemu-img'
  40. ] %}
  41. {% endif %}
  42. {% elif base_distro in ['debian', 'ubuntu'] %}
  43. {% set cinder_base_packages = [
  44. 'ceph-common',
  45. 'lvm2',
  46. 'cryptsetup',
  47. 'qemu-utils'
  48. ] %}
  49. {% endif %}
  50. {{ macros.install_packages(cinder_base_packages | customizable("packages")) }}
  51. {% set cinder_base_pip_packages = [
  52. '/cinder'
  53. ] %}
  54. ADD cinder-base-archive /cinder-base-source
  55. RUN ln -s cinder-base-source/* cinder \
  56. && {{ macros.install_pip(cinder_base_pip_packages | customizable("pip_packages")) }} \
  57. && mkdir -p /etc/cinder \
  58. && cp -r /cinder/etc/cinder/* /etc/cinder/ \
  59. && chown -R cinder: /etc/cinder \
  60. && sed -i 's|^exec_dirs.*|exec_dirs=/var/lib/kolla/venv/bin,/sbin,/usr/sbin,/bin,/usr/bin,/usr/local/bin,/usr/local/sbin|g' /etc/cinder/rootwrap.conf
  61. {% endif %}
  62. COPY cinder_sudoers /etc/sudoers.d/kolla_cinder_sudoers
  63. COPY extend_start.sh /usr/local/bin/kolla_extend_start
  64. RUN chmod 750 /etc/sudoers.d \
  65. && chmod 440 /etc/sudoers.d/kolla_cinder_sudoers \
  66. && touch /usr/local/bin/kolla_cinder_extend_start \
  67. && chmod 755 /usr/local/bin/kolla_extend_start /usr/local/bin/kolla_cinder_extend_start
  68. {% block cinder_base_footer %}{% endblock %}