aboutsummaryrefslogtreecommitdiff
path: root/docker/centos/binary/horizon
diff options
context:
space:
mode:
authorSam Yaple <sam@yaple.net>2015-05-13 06:46:24 -0500
committerSam Yaple <sam@yaple.net>2015-05-15 01:32:22 -0500
commit13062e23e86b5d86020949754540460cb5b0b4fe (patch)
treee0b3c8411418949a3d8df221da7c8cb2831b6d5d /docker/centos/binary/horizon
parent354ba01c8f5c7e1695cbea3bfc07aee5b75e76d9 (diff)
downloadkolla-13062e23e86b5d86020949754540460cb5b0b4fe.tar.gz
kolla-13062e23e86b5d86020949754540460cb5b0b4fe.zip
Restructure builds to allow more flexibility
As a restructure, nothing is changed from the original behaviour and naming despite the file structure changing. The symlinks to build had to be updated generating lots of "deleted" and "new_file". The new structure is: docker/${base_distro}/${type}/${container} base_distro == centos, ubuntu, fedora, etc type == source, binary, rdo type rdo is a symlink to binary for backwards compatibility Two new flags are added to the build-all script to support the ability to support different base distros and a flag to support binary or source containers. There are several added folders that are empty to hold the directory structure for future containers of these types. To use a prefix other than centos-rdo- you can set PREFIX in the toplevel directory .buildconf file Change-Id: Ifc7bac0d827470f506c8b5c004a833da9ce13b90
Diffstat (limited to 'docker/centos/binary/horizon')
-rw-r--r--docker/centos/binary/horizon/Dockerfile16
l---------docker/centos/binary/horizon/build1
-rwxr-xr-xdocker/centos/binary/horizon/start.sh36
3 files changed, 53 insertions, 0 deletions
diff --git a/docker/centos/binary/horizon/Dockerfile b/docker/centos/binary/horizon/Dockerfile
new file mode 100644
index 000000000..2c34ee03a
--- /dev/null
+++ b/docker/centos/binary/horizon/Dockerfile
@@ -0,0 +1,16 @@
+FROM %%KOLLA_NAMESPACE%%/%%KOLLA_PREFIX%%base:%%KOLLA_TAG%%
+MAINTAINER Kolla Project (https://launchpad.net/kolla)
+
+RUN yum -y install \
+ openstack-dashboard \
+ httpd \
+ httpd-mod-wsgi \
+ && yum clean all \
+ && chown -R apache:apache /usr/share/openstack-dashboard/static
+
+# The chown is required because of this packaging bug:
+# https://bugzilla.redhat.com/show_bug.cgi?id=1219006
+
+ADD ./start.sh /start.sh
+
+CMD ["/start.sh"]
diff --git a/docker/centos/binary/horizon/build b/docker/centos/binary/horizon/build
new file mode 120000
index 000000000..8d652f7ee
--- /dev/null
+++ b/docker/centos/binary/horizon/build
@@ -0,0 +1 @@
+../../../../tools/build-docker-image \ No newline at end of file
diff --git a/docker/centos/binary/horizon/start.sh b/docker/centos/binary/horizon/start.sh
new file mode 100755
index 000000000..4e720bb87
--- /dev/null
+++ b/docker/centos/binary/horizon/start.sh
@@ -0,0 +1,36 @@
+#!/bin/bash
+set -e
+
+: ${HORIZON_KEYSTONE_USER:=horizon}
+
+. /opt/kolla/kolla-common.sh
+
+fail_unless_os_service_running keystone
+fail_unless_os_service_running glance
+fail_unless_os_service_running nova
+
+export SERVICE_TOKEN="${KEYSTONE_ADMIN_TOKEN}"
+export SERVICE_ENDPOINT="${KEYSTONE_AUTH_PROTOCOL}://${KEYSTONE_ADMIN_SERVICE_HOST}:35357/v2.0"
+
+cfg=/etc/openstack-dashboard/local_settings
+httpdcfg=/etc/httpd/conf.d/openstack-dashboard.conf
+
+sed -ri 's/ALLOWED_HOSTS = \['\''horizon.example.com'\'', '\''localhost'\''\]/ALLOWED_HOSTS = \['\''*'\'', \]/' /etc/openstack-dashboard/local_settings
+
+sed -ri 's/OPENSTACK_KEYSTONE_URL = \"http:\/\/%s:5000\/v2.0\" % OPENSTACK_HOST/OPENSTACK_KEYSTONE_URL = \"http:\/\/'"$KEYSTONE_PUBLIC_SERVICE_HOST"':5000\/v2.0\"/' /etc/openstack-dashboard/local_settings
+
+sed -ri 's/OPENSTACK_HOST = \"127.0.0.1\"/OPENSTACK_HOST = \"'"$KEYSTONE_PUBLIC_SERVICE_HOST"'\" /' /etc/openstack-dashboard/local_settings
+
+# Make sure we launch horizon using the default value for WEBROOT, which is
+# '/'.
+sed -ri '/^WEBROOT =.+/d' $cfg
+sed -ri 's,^(WSGIScriptAlias) /dashboard (/usr/share/openstack-dashboard/openstack_dashboard/wsgi/django.wsgi),\1 / \2,' $httpdcfg
+sed -ri 's,^(Alias /dashboard)(/static /usr/share/openstack-dashboard/static),Alias \2,' $httpdcfg
+
+# This step is required because of:
+# https://bugzilla.redhat.com/show_bug.cgi?id=1220070
+# Running this in the Dockerfile didn't fix the HTTP/500 as a result of the
+# missing compress action.
+python /usr/share/openstack-dashboard/manage.py compress
+
+/usr/sbin/httpd -DFOREGROUND