aboutsummaryrefslogtreecommitdiff
path: root/docker
diff options
context:
space:
mode:
Diffstat (limited to 'docker')
-rw-r--r--docker/zun/zun-api/Dockerfile.j22
-rw-r--r--docker/zun/zun-api/extend_start.sh10
-rw-r--r--docker/zun/zun-base/Dockerfile.j242
-rw-r--r--docker/zun/zun-compute/Dockerfile.j22
4 files changed, 46 insertions, 10 deletions
diff --git a/docker/zun/zun-api/Dockerfile.j2 b/docker/zun/zun-api/Dockerfile.j2
index 01f665b43..19e73ffb0 100644
--- a/docker/zun/zun-api/Dockerfile.j2
+++ b/docker/zun/zun-api/Dockerfile.j2
@@ -15,5 +15,3 @@ RUN chmod 755 /usr/local/bin/kolla_zun_extend_start
{% block zun_api_footer %}{% endblock %}
{% block footer %}{% endblock %}
-
-USER zun
diff --git a/docker/zun/zun-api/extend_start.sh b/docker/zun/zun-api/extend_start.sh
index eaed680e2..92f669064 100644
--- a/docker/zun/zun-api/extend_start.sh
+++ b/docker/zun/zun-api/extend_start.sh
@@ -1,5 +1,15 @@
#!/bin/bash
+# NOTE(pbourke): httpd will not clean up after itself in some cases which
+# results in the container not being able to restart. (bug #1489676, 1557036)
+if [[ "${KOLLA_BASE_DISTRO}" =~ debian|ubuntu ]]; then
+ # Loading Apache2 ENV variables
+ . /etc/apache2/envvars
+ rm -rf /var/run/apache2/*
+else
+ rm -rf /var/run/httpd/* /run/httpd/* /tmp/httpd*
+fi
+
# Bootstrap and exit if KOLLA_BOOTSTRAP variable is set. This catches all cases
# of the KOLLA_BOOTSTRAP variable being set, including empty.
if [[ "${!KOLLA_BOOTSTRAP[@]}" ]]; then
diff --git a/docker/zun/zun-base/Dockerfile.j2 b/docker/zun/zun-base/Dockerfile.j2
index f5ba92c92..662421394 100644
--- a/docker/zun/zun-base/Dockerfile.j2
+++ b/docker/zun/zun-base/Dockerfile.j2
@@ -5,6 +5,8 @@ LABEL maintainer="{{ maintainer }}" name="{{ image_name }}" build-date="{{ build
{% import "macros.j2" as macros with context %}
+{{ macros.configure_user(name='zun') }}
+
{% if install_type == 'binary' %}
RUN echo '{{ install_type }} not yet available for {{ base_distro }}' \
@@ -12,6 +14,33 @@ RUN echo '{{ install_type }} not yet available for {{ base_distro }}' \
{% elif install_type == 'source' %}
+ {% if base_distro in ['centos', 'oraclelinux', 'rhel'] %}
+
+ {% set zun_base_packages = [
+ 'httpd',
+ 'mod_wsgi',
+ 'mod_ssl',
+ 'python-ldappool'
+ ] %}
+
+{{ macros.install_packages(zun_base_packages | customizable("packages")) }}
+RUN mkdir -p /var/www/cgi-bin/zun \
+ && sed -i -r 's,^(Listen 80),#\1,' /etc/httpd/conf/httpd.conf \
+ && sed -i -r 's,^(Listen 443),#\1,' /etc/httpd/conf.d/ssl.conf
+
+ {% elif base_distro in ['debian', 'ubuntu'] %}
+
+ {% set zun_base_packages = [
+ 'apache2',
+ 'libapache2-mod-wsgi',
+ 'python-ldappool'
+ ] %}
+
+{{ macros.install_packages(zun_base_packages | customizable("packages")) }}
+RUN mkdir -p /var/www/cgi-bin/zun \
+ && echo > /etc/apache2/ports.conf
+ {% endif %}
+
ADD zun-base-archive /zun-base-source
{% set zun_base_pip_packages = [
@@ -19,18 +48,19 @@ ADD zun-base-archive /zun-base-source
] %}
RUN ln -s zun-base-source/* zun \
- && useradd --user-group --create-home --home-dir /var/lib/zun zun \
&& {{ macros.install_pip(zun_base_pip_packages | customizable("pip_packages")) }} \
- && mkdir -p /etc/zun \
- && cp -r /zun/etc/* /etc/zun/ \
- && chown -R zun: /etc/zun
+ && mkdir -p /etc/zun /var/www/cgi-bin/zun \
+ && cp -r /zun/etc/zun/* /etc/zun/ \
+ && cp /zun/zun/api/app.wsgi /var/www/cgi-bin/zun \
+ && cp -r /zun/etc/nova /etc/zun/ \
+ && chown -R zun: /etc/zun /var/www/cgi-bin/zun
{% endif %}
COPY extend_start.sh /usr/local/bin/kolla_extend_start
-RUN usermod -a -G kolla zun \
- && touch /usr/local/bin/kolla_zun_extend_start \
+RUN touch /usr/local/bin/kolla_zun_extend_start \
+ && chmod 755 /var/www/cgi-bin/zun \
&& chmod 755 /usr/local/bin/kolla_extend_start /usr/local/bin/kolla_zun_extend_start
{% block zun_base_footer %}{% endblock %}
diff --git a/docker/zun/zun-compute/Dockerfile.j2 b/docker/zun/zun-compute/Dockerfile.j2
index 23ab689f7..a469598ec 100644
--- a/docker/zun/zun-compute/Dockerfile.j2
+++ b/docker/zun/zun-compute/Dockerfile.j2
@@ -12,5 +12,3 @@ RUN echo '{{ install_type }} not yet available for {{ base_distro }}' \
{% block zun_compute_footer %}{% endblock %}
{% block footer %}{% endblock %}
-
-USER zun