diff options
| author | Bai Yongjun <byj994@163.com> | 2018-11-22 22:27:02 +0800 |
|---|---|---|
| committer | Taeha Kim <kthguru@gmail.com> | 2019-03-27 16:19:13 +0000 |
| commit | 265f643295efa50b8d5c7dc716353883d645c588 (patch) | |
| tree | 649a7e668aabc7b789da61a920b6aef6815edb4b /docker/cyborg/cyborg-api | |
| parent | 09f37541d8e57d85aa568a0ad6a23c44ef11a36e (diff) | |
| download | kolla-265f643295efa50b8d5c7dc716353883d645c588.tar.gz kolla-265f643295efa50b8d5c7dc716353883d645c588.zip | |
Add cyborg to kolla
Because kolla not have cyborg so should add this.
Implements: blueprint add-cyborg
Change-Id: I497e67e3a754fccfd2ef5a82f13ccfaf890a6fcd
Diffstat (limited to 'docker/cyborg/cyborg-api')
| -rw-r--r-- | docker/cyborg/cyborg-api/Dockerfile.j2 | 42 | ||||
| -rw-r--r-- | docker/cyborg/cyborg-api/extend_start.sh | 16 |
2 files changed, 58 insertions, 0 deletions
diff --git a/docker/cyborg/cyborg-api/Dockerfile.j2 b/docker/cyborg/cyborg-api/Dockerfile.j2 new file mode 100644 index 000000000..0d1857220 --- /dev/null +++ b/docker/cyborg/cyborg-api/Dockerfile.j2 @@ -0,0 +1,42 @@ +FROM {{ namespace }}/{{ image_prefix }}cyborg-base:{{ tag }} +LABEL maintainer="{{ maintainer }}" name="{{ image_name }}" build-date="{{ build_date }}" + +{% block cyborg_api_header %}{% endblock %} +{% import "macros.j2" as macros with context %} + +{% if install_type == 'binary' %} + +RUN echo '{{ install_type }} not yet available for {{ base_distro }}' \ + && /bin/false + +{% elif install_type == 'source' %} + {% if base_distro in ['centos', 'oraclelinux', 'rhel'] %} + {% set cyborg_api_packages = [ + 'mod_ssl', + 'mod_wsgi' + ] %} + {% elif base_distro in ['debian', 'ubuntu'] %} + {% set cyborg_api_packages = [ + 'apache2', + 'libapache2-mod-wsgi' + ] %} + {% endif %} + +{% endif %} + +{{ macros.install_packages(cyborg_api_packages | customizable("packages")) }} + +{% if base_distro in ['centos', 'oraclelinux', 'rhel'] %} +RUN 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'] %} +RUN echo > /etc/apache2/ports.conf + +{% endif %} + +COPY extend_start.sh /usr/local/bin/kolla_cyborg_extend_start +RUN chmod 755 /usr/local/bin/kolla_cyborg_extend_start + +{% block cyborg_api_footer %}{% endblock %} +{% block footer %}{% endblock %} diff --git a/docker/cyborg/cyborg-api/extend_start.sh b/docker/cyborg/cyborg-api/extend_start.sh new file mode 100644 index 000000000..a96619d93 --- /dev/null +++ b/docker/cyborg/cyborg-api/extend_start.sh @@ -0,0 +1,16 @@ +#!/bin/bash + +# 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 + cyborg-dbsync + exit 0 +fi + +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 |
