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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  1. FROM {{ namespace }}/{{ image_prefix }}openstack-base:{{ tag }}
  2. LABEL maintainer="{{ maintainer }}" name="{{ image_name }}" build-date="{{ build_date }}"
  3. {% block horizon_header %}{% endblock %}
  4. {% import "macros.j2" as macros with context %}
  5. {{ macros.configure_user(name='horizon') }}
  6. {% if install_type == 'binary' %}
  7. {% if base_distro in ['centos', 'oraclelinux', 'rhel'] %}
  8. {% set horizon_packages = [
  9. 'gettext',
  10. 'httpd',
  11. 'mod_ssl',
  12. 'mod_wsgi',
  13. 'openstack-cloudkitty-ui',
  14. 'openstack-dashboard',
  15. 'openstack-designate-ui',
  16. 'openstack-heat-ui',
  17. 'openstack-ironic-ui',
  18. 'openstack-magnum-ui',
  19. 'openstack-manila-ui',
  20. 'openstack-mistral-ui',
  21. 'openstack-murano-ui',
  22. 'openstack-neutron-lbaas-ui',
  23. 'openstack-octavia-ui',
  24. 'openstack-sahara-ui',
  25. 'openstack-trove-ui',
  26. 'openstack-vitrage-ui'
  27. ] %}
  28. {{ macros.install_packages(horizon_packages | customizable("packages")) }}
  29. {% block horizon_redhat_binary_setup %}
  30. RUN sed -i -r 's,^(Listen 80),#\1,' /etc/httpd/conf/httpd.conf \
  31. && sed -i -r 's,^(Listen 443),#\1,' /etc/httpd/conf.d/ssl.conf \
  32. && ln -s /usr/share/openstack-dashboard/openstack_dashboard /usr/lib/python2.7/site-packages/openstack_dashboard \
  33. && ln -s /usr/share/openstack-dashboard/static /usr/lib/python2.7/site-packages/static \
  34. && chown -R horizon: /etc/openstack-dashboard /usr/share/openstack-dashboard \
  35. && chown -R apache: /usr/share/openstack-dashboard/static \
  36. && sed -i "s|WEBROOT = '/dashboard/'|WEBROOT = '/'|" /etc/openstack-dashboard/local_settings \
  37. && cp /usr/share/openstack-dashboard/manage.py /usr/bin/manage.py \
  38. && rm -f /usr/share/openstack-dashboard/openstack_dashboard/local/enabled/?[^_]*.py* \
  39. && rm -f /usr/lib/python2.7/site-packages/openstack_dashboard/local/enabled/?[^_]*.py* \
  40. && for locale in /usr/lib/python2.7/site-packages/*/locale; do \
  41. (cd ${locale%/*} && /usr/bin/python /usr/bin/manage.py compilemessages) \
  42. done
  43. {% endblock %}
  44. {% elif base_distro in ['debian', 'ubuntu'] %}
  45. {% set horizon_packages = [
  46. 'apache2',
  47. 'gettext',
  48. 'libapache2-mod-wsgi',
  49. 'locales',
  50. 'openstack-dashboard',
  51. 'python-designate-dashboard',
  52. 'python-heat-dashboard',
  53. 'python-manila-ui',
  54. 'python-murano-dashboard',
  55. 'python-neutron-lbaas-dashboard',
  56. 'python-sahara-dashboard',
  57. 'python-trove-dashboard',
  58. 'tzdata'
  59. ] %}
  60. {{ macros.install_packages(horizon_packages | customizable("packages")) }}
  61. {% block horizon_ubuntu_binary_setup %}
  62. RUN echo > /etc/apache2/ports.conf \
  63. && sed -i 's|\(ServerTokens \)OS|\1Prod|' /etc/apache2/conf-available/security.conf \
  64. && ln -s ../mods-available/headers.load /etc/apache2/mods-enabled/headers.load \
  65. && ln -s ../mods-available/expires.load /etc/apache2/mods-enabled/expires.load \
  66. && cp /usr/share/openstack-dashboard/openstack_dashboard/conf/*.json /etc/openstack-dashboard \
  67. && cp /usr/share/openstack-dashboard/manage.py /usr/bin/manage.py \
  68. && rm /etc/apache2/conf-enabled/openstack-dashboard.conf \
  69. && rm /etc/openstack-dashboard/local_settings.py \
  70. && rm /usr/share/openstack-dashboard/openstack_dashboard/local/local_settings.py \
  71. && rm -rf /usr/lib/python2.7/site-packages/openstack_dashboard \
  72. && ln -s /etc/openstack-dashboard/local_settings /usr/share/openstack-dashboard/openstack_dashboard/local/local_settings.py \
  73. && ln -s /usr/share/openstack-dashboard/openstack_dashboard /usr/lib/python2.7/site-packages/openstack_dashboard \
  74. && ln -s /usr/share/openstack-dashboard/static /usr/lib/python2.7/site-packages/static \
  75. && for locale in /usr/lib/python2.7/site-packages/*/locale; do \
  76. (cd ${locale%/*} && /usr/bin/python /usr/bin/manage.py compilemessages) \
  77. done
  78. {% endblock %}
  79. {% endif %}
  80. {% elif install_type == 'source' %}
  81. {% if base_distro in ['centos', 'oraclelinux', 'rhel'] %}
  82. {% set horizon_packages = [
  83. 'gettext',
  84. 'httpd',
  85. 'mod_ssl',
  86. 'mod_wsgi'
  87. ] %}
  88. {{ macros.install_packages(horizon_packages | customizable("packages")) }}
  89. {% block horizon_redhat_source_setup %}
  90. RUN sed -i -r 's,^(Listen 80),#\1,' /etc/httpd/conf/httpd.conf \
  91. && sed -i -r 's,^(Listen 443),#\1,' /etc/httpd/conf.d/ssl.conf
  92. {% endblock %}
  93. {% elif base_distro in ['debian', 'ubuntu'] %}
  94. {% set horizon_packages = [
  95. 'apache2',
  96. 'gettext',
  97. 'libapache2-mod-wsgi',
  98. 'locales',
  99. 'tzdata'
  100. ] %}
  101. {{ macros.install_packages(horizon_packages | customizable("packages")) }}
  102. {% block horizon_ubuntu_source_setup %}
  103. RUN echo > /etc/apache2/ports.conf \
  104. && ln -s ../mods-available/headers.load /etc/apache2/mods-enabled/headers.load
  105. {% endblock %}
  106. {% endif %}
  107. ADD horizon-archive /horizon-source
  108. ADD plugins-archive /
  109. {% set horizon_pip_packages = [
  110. '/horizon'
  111. ] %}
  112. {% set horizon_plugins_pip_packages = [
  113. '/plugins/*'
  114. ] %}
  115. RUN ln -s horizon-source/* horizon \
  116. && {{ macros.install_pip(horizon_pip_packages | customizable("pip_packages")) }} \
  117. && mkdir -p /etc/openstack-dashboard \
  118. && cp -r /horizon/openstack_dashboard/conf/* /etc/openstack-dashboard/ \
  119. && cp /horizon/openstack_dashboard/local/local_settings.py.example /etc/openstack-dashboard/local_settings \
  120. && cp /horizon/manage.py /var/lib/kolla/venv/bin/manage.py \
  121. && if [ "$(ls /plugins)" ]; then \
  122. {{ macros.install_pip(horizon_plugins_pip_packages) }}; \
  123. fi \
  124. && for locale in /var/lib/kolla/venv/lib/python2.7/site-packages/*/locale; do \
  125. (cd ${locale%/*} && /var/lib/kolla/venv/bin/python /var/lib/kolla/venv/bin/manage.py compilemessages) \
  126. done \
  127. && chown -R horizon: /etc/openstack-dashboard /var/lib/kolla/venv/lib/python2.7/site-packages/static
  128. {% endif %}
  129. COPY extend_start.sh /usr/local/bin/kolla_extend_start
  130. RUN chmod 755 /usr/local/bin/kolla_extend_start
  131. {% block horizon_footer %}{% endblock %}
  132. {% block footer %}{% endblock %}