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.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  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. && cp /usr/share/openstack-dashboard/openstack_dashboard/local/enabled/_18*.py* /usr/lib/python2.7/site-packages/sahara_dashboard/enabled/ \
  39. && rm -f /usr/share/openstack-dashboard/openstack_dashboard/local/enabled/?[^_]*.py* \
  40. && rm -f /usr/lib/python2.7/site-packages/openstack_dashboard/local/enabled/?[^_]*.py* \
  41. && for locale in /usr/lib/python2.7/site-packages/*/locale; do \
  42. (cd ${locale%/*} && /usr/bin/python /usr/bin/manage.py compilemessages) \
  43. done
  44. {% endblock %}
  45. {% elif base_distro in ['debian', 'ubuntu'] %}
  46. {% set horizon_packages = [
  47. 'apache2',
  48. 'gettext',
  49. 'libapache2-mod-wsgi',
  50. 'locales',
  51. 'openstack-dashboard',
  52. 'python-designate-dashboard',
  53. 'python-heat-dashboard',
  54. 'python-manila-ui',
  55. 'python-murano-dashboard',
  56. 'python-neutron-lbaas-dashboard',
  57. 'python-sahara-dashboard',
  58. 'python-trove-dashboard',
  59. 'tzdata'
  60. ] %}
  61. {{ macros.install_packages(horizon_packages | customizable("packages")) }}
  62. {% block horizon_ubuntu_binary_setup %}
  63. RUN echo > /etc/apache2/ports.conf \
  64. && sed -i 's|\(ServerTokens \)OS|\1Prod|' /etc/apache2/conf-available/security.conf \
  65. && ln -s ../mods-available/headers.load /etc/apache2/mods-enabled/headers.load \
  66. && ln -s ../mods-available/expires.load /etc/apache2/mods-enabled/expires.load \
  67. && cp /usr/share/openstack-dashboard/openstack_dashboard/conf/*.json /etc/openstack-dashboard \
  68. && cp /usr/share/openstack-dashboard/manage.py /usr/bin/manage.py \
  69. && rm /etc/apache2/conf-enabled/openstack-dashboard.conf \
  70. && rm /etc/openstack-dashboard/local_settings.py \
  71. && rm /usr/share/openstack-dashboard/openstack_dashboard/local/local_settings.py \
  72. && rm -rf /usr/lib/python2.7/site-packages/openstack_dashboard \
  73. && ln -s /etc/openstack-dashboard/local_settings /usr/share/openstack-dashboard/openstack_dashboard/local/local_settings.py \
  74. && ln -s /usr/share/openstack-dashboard/openstack_dashboard /usr/lib/python2.7/site-packages/openstack_dashboard \
  75. && ln -s /usr/share/openstack-dashboard/static /usr/lib/python2.7/site-packages/static \
  76. && for locale in /usr/lib/python2.7/site-packages/*/locale; do \
  77. (cd ${locale%/*} && /usr/bin/python /usr/bin/manage.py compilemessages) \
  78. done
  79. {% endblock %}
  80. {% endif %}
  81. {% elif install_type == 'source' %}
  82. {% if base_distro in ['centos', 'oraclelinux', 'rhel'] %}
  83. {% set horizon_packages = [
  84. 'gettext',
  85. 'httpd',
  86. 'mod_ssl',
  87. 'mod_wsgi'
  88. ] %}
  89. {{ macros.install_packages(horizon_packages | customizable("packages")) }}
  90. {% block horizon_redhat_source_setup %}
  91. RUN sed -i -r 's,^(Listen 80),#\1,' /etc/httpd/conf/httpd.conf \
  92. && sed -i -r 's,^(Listen 443),#\1,' /etc/httpd/conf.d/ssl.conf
  93. {% endblock %}
  94. {% elif base_distro in ['debian', 'ubuntu'] %}
  95. {% set horizon_packages = [
  96. 'apache2',
  97. 'gettext',
  98. 'libapache2-mod-wsgi',
  99. 'locales',
  100. 'tzdata'
  101. ] %}
  102. {{ macros.install_packages(horizon_packages | customizable("packages")) }}
  103. {% block horizon_ubuntu_source_setup %}
  104. RUN echo > /etc/apache2/ports.conf \
  105. && ln -s ../mods-available/headers.load /etc/apache2/mods-enabled/headers.load
  106. {% endblock %}
  107. {% endif %}
  108. ADD horizon-archive /horizon-source
  109. ADD plugins-archive /
  110. {% set horizon_pip_packages = [
  111. '/horizon'
  112. ] %}
  113. {% set horizon_plugins_pip_packages = [
  114. '/plugins/*'
  115. ] %}
  116. RUN ln -s horizon-source/* horizon \
  117. && {{ macros.install_pip(horizon_pip_packages | customizable("pip_packages")) }} \
  118. && mkdir -p /etc/openstack-dashboard \
  119. && cp -r /horizon/openstack_dashboard/conf/* /etc/openstack-dashboard/ \
  120. && cp /horizon/openstack_dashboard/local/local_settings.py.example /etc/openstack-dashboard/local_settings \
  121. && cp /horizon/manage.py /var/lib/kolla/venv/bin/manage.py \
  122. && if [ "$(ls /plugins)" ]; then \
  123. {{ macros.install_pip(horizon_plugins_pip_packages) }}; \
  124. fi \
  125. && for locale in /var/lib/kolla/venv/lib/python2.7/site-packages/*/locale; do \
  126. (cd ${locale%/*} && /var/lib/kolla/venv/bin/python /var/lib/kolla/venv/bin/manage.py compilemessages) \
  127. done \
  128. && chown -R horizon: /etc/openstack-dashboard /var/lib/kolla/venv/lib/python2.7/site-packages/static
  129. {% endif %}
  130. COPY extend_start.sh /usr/local/bin/kolla_extend_start
  131. RUN chmod 755 /usr/local/bin/kolla_extend_start
  132. {% block horizon_footer %}{% endblock %}
  133. {% block footer %}{% endblock %}