2015-09-17 09:35:33 -07:00
|
|
|
FROM {{ namespace }}/{{ image_prefix }}openstack-base:{{ tag }}
|
2015-11-23 12:38:58 +05:30
|
|
|
MAINTAINER {{ maintainer }}
|
2015-08-12 04:31:42 +02:00
|
|
|
|
2016-08-03 09:42:58 +00:00
|
|
|
{% import "macros.j2" as macros with context %}
|
|
|
|
|
2015-08-12 04:31:42 +02:00
|
|
|
{% if install_type == 'binary' %}
|
2015-09-04 02:15:03 -07:00
|
|
|
{% if base_distro in ['centos', 'fedora', 'oraclelinux', 'rhel'] %}
|
2015-08-12 04:31:42 +02:00
|
|
|
|
2016-08-03 09:42:58 +00:00
|
|
|
{% set horizon_packages = [
|
|
|
|
'openstack-dashboard',
|
|
|
|
'httpd',
|
|
|
|
'mod_wsgi',
|
|
|
|
'gettext'
|
|
|
|
] %}
|
|
|
|
|
2016-08-12 08:24:11 +10:00
|
|
|
{{ macros.install_packages(horizon_packages | customizable("packages")) }}
|
2016-08-03 09:42:58 +00:00
|
|
|
|
|
|
|
{% block horizon_redhat_binary_setup %}
|
|
|
|
RUN useradd --user-group horizon \
|
2015-08-28 17:18:25 -07:00
|
|
|
&& sed -i -r 's,^(Listen 80),#\1,' /etc/httpd/conf/httpd.conf \
|
|
|
|
&& ln -s /usr/share/openstack-dashboard/openstack_dashboard /usr/lib/python2.7/site-packages/openstack_dashboard \
|
|
|
|
&& ln -s /usr/share/openstack-dashboard/static /usr/lib/python2.7/site-packages/static \
|
2015-12-11 19:16:25 +03:00
|
|
|
&& chown -R horizon: /etc/openstack-dashboard /usr/share/openstack-dashboard \
|
2016-08-03 09:42:58 +00:00
|
|
|
&& chown -R apache: /usr/share/openstack-dashboard/static \
|
|
|
|
&& sed -i "s|WEBROOT = '/dashboard/'|WEBROOT = '/'|" /etc/openstack-dashboard/local_settings \
|
2015-08-28 17:18:25 -07:00
|
|
|
&& cp /usr/share/openstack-dashboard/manage.py /usr/bin/manage.py \
|
2016-04-23 21:19:16 +08:00
|
|
|
&& /usr/bin/python /usr/bin/manage.py collectstatic --noinput --clear \
|
|
|
|
&& (cd /usr/lib/python2.7/site-packages/horizon && /usr/bin/python /usr/bin/manage.py compilemessages) \
|
|
|
|
&& (cd /usr/lib/python2.7/site-packages/openstack_dashboard && /usr/bin/python /usr/bin/manage.py compilemessages)
|
2016-08-03 09:42:58 +00:00
|
|
|
{% endblock %}
|
2015-08-12 04:31:42 +02:00
|
|
|
|
2016-01-04 11:39:44 +01:00
|
|
|
{% elif base_distro in ['ubuntu'] %}
|
|
|
|
|
2016-08-03 09:42:58 +00:00
|
|
|
{% set horizon_packages = [
|
|
|
|
'openstack-dashboard',
|
|
|
|
'apache2',
|
|
|
|
'libapache2-mod-wsgi',
|
|
|
|
'gettext'
|
|
|
|
] %}
|
2016-01-04 11:39:44 +01:00
|
|
|
|
2016-08-12 08:24:11 +10:00
|
|
|
{{ macros.install_packages(horizon_packages | customizable("packages")) }}
|
2016-08-03 09:42:58 +00:00
|
|
|
|
|
|
|
{% block horizon_ubuntu_binary_setup %}
|
|
|
|
RUN echo > /etc/apache2/ports.conf \
|
|
|
|
&& sed -i 's|\(ServerTokens \)OS|\1Prod|' /etc/apache2/conf-available/security.conf \
|
|
|
|
&& ln -s ../mods-available/headers.load /etc/apache2/mods-enabled/headers.load \
|
2016-07-24 01:27:59 +08:00
|
|
|
&& ln -s ../mods-available/expires.load /etc/apache2/mods-enabled/expires.load \
|
2016-08-03 09:42:58 +00:00
|
|
|
&& cp /usr/share/openstack-dashboard/openstack_dashboard/conf/*.json /etc/openstack-dashboard \
|
2016-01-04 11:39:44 +01:00
|
|
|
&& sed -i "s|WEBROOT='/horizon/'|WEBROOT = '/'|" /etc/openstack-dashboard/local_settings.py \
|
|
|
|
&& sed -i "s|^POLICY_FILES_PATH|POLICY_FILES_PATH = '/etc/openstack-dashboard'|" /etc/openstack-dashboard/local_settings.py \
|
|
|
|
&& cp /usr/share/openstack-dashboard/manage.py /usr/bin/manage.py \
|
|
|
|
&& /usr/bin/python /usr/bin/manage.py collectstatic --noinput \
|
|
|
|
&& rm /etc/apache2/conf-enabled/openstack-dashboard.conf \
|
|
|
|
&& rm /etc/openstack-dashboard/local_settings.py \
|
|
|
|
&& rm /usr/share/openstack-dashboard/openstack_dashboard/local/local_settings.py \
|
|
|
|
&& ln -s /etc/openstack-dashboard/local_settings /usr/share/openstack-dashboard/openstack_dashboard/local/local_settings.py \
|
|
|
|
&& ln -s /usr/share/openstack-dashboard/openstack_dashboard /usr/lib/python2.7/site-packages/openstack_dashboard \
|
2016-04-23 21:19:16 +08:00
|
|
|
&& ln -s /usr/share/openstack-dashboard/static /usr/lib/python2.7/site-packages/static \
|
|
|
|
&& (cd /usr/lib/python2.7/site-packages/horizon && /usr/bin/python /usr/bin/manage.py compilemessages) \
|
|
|
|
&& (cd /usr/lib/python2.7/site-packages/openstack_dashboard && /usr/bin/python /usr/bin/manage.py compilemessages)
|
2016-08-03 09:42:58 +00:00
|
|
|
{% endblock %}
|
2016-01-04 11:39:44 +01:00
|
|
|
|
2015-08-12 04:31:42 +02:00
|
|
|
{% endif %}
|
|
|
|
{% elif install_type == 'source' %}
|
2015-09-04 02:15:03 -07:00
|
|
|
{% if base_distro in ['centos', 'fedora', 'oraclelinux', 'rhel'] %}
|
2015-08-12 04:31:42 +02:00
|
|
|
|
2016-08-03 09:42:58 +00:00
|
|
|
{% set horizon_packages = [
|
|
|
|
'httpd',
|
|
|
|
'mod_wsgi',
|
|
|
|
'gettext'
|
|
|
|
] %}
|
|
|
|
|
2016-08-12 08:24:11 +10:00
|
|
|
{{ macros.install_packages(horizon_packages | customizable("packages")) }}
|
2016-08-03 09:42:58 +00:00
|
|
|
|
|
|
|
{% block horizon_redhat_source_setup %}
|
|
|
|
RUN sed -i -r 's,^(Listen 80),#\1,' /etc/httpd/conf/httpd.conf
|
|
|
|
{% endblock %}
|
2015-08-12 04:31:42 +02:00
|
|
|
|
2015-08-23 12:01:35 +00:00
|
|
|
{% elif base_distro in ['ubuntu', 'debian'] %}
|
2015-08-12 04:31:42 +02:00
|
|
|
|
2016-08-03 09:42:58 +00:00
|
|
|
{% set horizon_packages = [
|
|
|
|
'apache2',
|
|
|
|
'libapache2-mod-wsgi',
|
|
|
|
'gettext'
|
|
|
|
] %}
|
|
|
|
|
2016-08-12 08:24:11 +10:00
|
|
|
{{ macros.install_packages(horizon_packages | customizable("packages")) }}
|
2016-08-03 09:42:58 +00:00
|
|
|
|
|
|
|
{% block horizon_ubuntu_source_setup %}
|
|
|
|
RUN echo > /etc/apache2/ports.conf \
|
2016-03-04 02:56:06 +00:00
|
|
|
&& ln -s ../mods-available/headers.load /etc/apache2/mods-enabled/headers.load
|
2016-08-03 09:42:58 +00:00
|
|
|
{% endblock %}
|
2015-08-23 12:01:35 +00:00
|
|
|
|
|
|
|
{% endif %}
|
|
|
|
|
2015-09-02 17:36:46 +03:00
|
|
|
ADD horizon-archive /horizon-source
|
2016-07-01 22:13:31 +02:00
|
|
|
ADD plugins-archive /
|
2015-09-02 17:36:46 +03:00
|
|
|
RUN ln -s horizon-source/* horizon \
|
2015-12-27 02:41:30 +00:00
|
|
|
&& /var/lib/kolla/venv/bin/pip --no-cache-dir install --upgrade -c requirements/upper-constraints.txt /horizon \
|
2015-08-23 12:01:35 +00:00
|
|
|
&& useradd --user-group horizon \
|
2015-08-27 10:32:49 +00:00
|
|
|
&& mkdir -p /etc/openstack-dashboard /home/horizon \
|
2015-11-18 07:22:17 +01:00
|
|
|
&& ln -s /etc/openstack-dashboard/local_settings /var/lib/kolla/venv/lib/python2.7/site-packages/openstack_dashboard/local/local_settings.py \
|
2015-08-23 12:01:35 +00:00
|
|
|
&& cp -r /horizon/openstack_dashboard/conf/* /etc/openstack-dashboard/ \
|
2015-08-28 17:18:25 -07:00
|
|
|
&& cp /horizon/openstack_dashboard/local/local_settings.py.example /etc/openstack-dashboard/local_settings \
|
2015-11-18 07:22:17 +01:00
|
|
|
&& cp /horizon/manage.py /var/lib/kolla/venv/bin/manage.py \
|
2016-07-01 22:13:31 +02:00
|
|
|
&& if [ "$(ls /plugins)" ]; then \
|
|
|
|
pip --no-cache-dir install --upgrade -c requirements/upper-constraints.txt /plugins/*; \
|
|
|
|
ln -s `find /plugins -name 'neutron-lbaas-dashboard-*' -type d`/neutron_lbaas_dashboard/enabled/_1481_project_ng_loadbalancersv2_panel.py \
|
|
|
|
/var/lib/kolla/venv/lib/python2.7/site-packages/openstack_dashboard/enabled/_1481_project_ng_loadbalancersv2_panel.py; \
|
|
|
|
fi \
|
2015-11-18 07:22:17 +01:00
|
|
|
&& /var/lib/kolla/venv/bin/python /var/lib/kolla/venv/bin/manage.py collectstatic --noinput --clear \
|
2016-04-23 21:19:16 +08:00
|
|
|
&& (cd /var/lib/kolla/venv/lib/python2.7/site-packages/horizon && /var/lib/kolla/venv/bin/python /var/lib/kolla/venv/bin/manage.py compilemessages) \
|
|
|
|
&& (cd /var/lib/kolla/venv/lib/python2.7/site-packages/openstack_dashboard && /var/lib/kolla/venv/bin/python /var/lib/kolla/venv/bin/manage.py compilemessages) \
|
2015-11-18 07:22:17 +01:00
|
|
|
&& chown -R horizon: /etc/openstack-dashboard /home/horizon /var/lib/kolla/venv/lib/python2.7/site-packages/static
|
2015-08-12 04:31:42 +02:00
|
|
|
|
|
|
|
{% endif %}
|
|
|
|
|
2015-09-30 11:23:39 +00:00
|
|
|
COPY extend_start.sh /usr/local/bin/kolla_extend_start
|
2015-11-13 08:53:49 +00:00
|
|
|
RUN chmod 755 /usr/local/bin/kolla_extend_start
|
2015-11-09 22:14:56 -05:00
|
|
|
|
2016-08-03 09:42:58 +00:00
|
|
|
{% block horizon_footer %}{% endblock %}
|
|
|
|
{% block footer %}{% endblock %}
|
2015-08-28 13:17:41 +03:00
|
|
|
{{ include_footer }}
|