From d27d31cc431206b1d439b5af2627b4c780056f38 Mon Sep 17 00:00:00 2001 From: Pete Birley Date: Mon, 16 Jan 2017 17:28:16 +0000 Subject: [PATCH] Add Apache2 to Heat containers (#5) * Add Apache2 to Heat containers * Restore --no-cache-dir to pip command * Fix Whitespace --- dockerfiles/Dockerfile-centos | 18 ++++++++++++++++-- dockerfiles/Dockerfile-debian | 14 ++++++++++---- dockerfiles/Dockerfile-ubuntu | 14 ++++++++++---- 3 files changed, 36 insertions(+), 10 deletions(-) diff --git a/dockerfiles/Dockerfile-centos b/dockerfiles/Dockerfile-centos index 6c8c546..20bf444 100644 --- a/dockerfiles/Dockerfile-centos +++ b/dockerfiles/Dockerfile-centos @@ -11,7 +11,10 @@ ARG GIT_REF_REPO=https://git.openstack.org/openstack/${PROJECT} RUN set -x \ && yum install --setopt=tsflags=nodocs -y \ # Project specific packages start - python \ + python \ + httpd \ + mod_ssl \ + mod_wsgi \ # Project specific packages end && yum install --setopt=tsflags=nodocs -y git \ # common install start @@ -41,10 +44,21 @@ RUN set -x \ && chown ${PROJECT}:${PROJECT} /etc/${PROJECT} /var/log/${PROJECT} /var/lib/${PROJECT} /var/cache/${PROJECT} \ # common install end # Project specific command block start - && pip install --no-cache-dir --no-index --no-compile --find-links /tmp/packages --constraint /tmp/packages/upper-constraints.txt python-memcached pymysql \ + && pip install --no-cache-dir --no-index --no-compile --find-links /tmp/packages --constraint /tmp/packages/upper-constraints.txt \ + python-memcached \ + pymysql \ && cp -rfv /tmp/${PROJECT}/etc/heat/* /etc/${PROJECT}/ \ && chown -R ${PROJECT}:${PROJECT} /etc/${PROJECT} \ && chown root:root /etc/${PROJECT}/policy.json \ + && sed -i 's/^Listen 80/#Listen 80/' /etc/httpd/conf/httpd.conf \ + && rm /etc/httpd/conf.d/* \ +# Provide compatibility with ubuntu/debian apache: + && ln -s /usr/sbin/httpd /usr/sbin/apache2 \ + && mkdir -p /etc/apache2/conf-enabled \ + && echo "IncludeOptional /etc/apache2/conf-enabled/*.conf" >> /etc/httpd/conf/httpd.conf \ + && mkdir -p /etc/apache2/mods-available \ + && echo "Include /etc/apache2/mods-available/*.conf" >> /etc/httpd/conf/httpd.conf \ + && touch /etc/apache2/envvars \ # Project specific command block end && yum history -y undo $(yum history list git | tail -2 | head -1 | awk '{ print $1}') \ && yum clean all \ diff --git a/dockerfiles/Dockerfile-debian b/dockerfiles/Dockerfile-debian index 4703fee..3def8af 100644 --- a/dockerfiles/Dockerfile-debian +++ b/dockerfiles/Dockerfile-debian @@ -9,10 +9,12 @@ ARG GIT_REF ARG GIT_REF_REPO=https://git.openstack.org/openstack/${PROJECT} RUN set -x \ - && apt-get update \ - && apt-get install -y --no-install-recommends \ + && apt-get update \ + && apt-get install -y --no-install-recommends \ # Project specific packages start - python \ + python \ + apache2 \ + libapache2-mod-wsgi \ # Project specific packages end && apt-get install -y --no-install-recommends ca-certificates curl git \ # common install start @@ -42,10 +44,14 @@ RUN set -x \ && chown ${PROJECT}:${PROJECT} /etc/${PROJECT} /var/log/${PROJECT} /var/lib/${PROJECT} /var/cache/${PROJECT} \ # common install end # Project specific command block start - && pip install --no-cache-dir --no-index --no-compile --find-links /tmp/packages --constraint /tmp/packages/upper-constraints.txt python-memcached pymysql \ + && pip install --no-cache-dir --no-index --no-compile --find-links /tmp/packages --constraint /tmp/packages/upper-constraints.txt \ + python-memcached \ + pymysql \ && cp -rfv /tmp/${PROJECT}/etc/heat/* /etc/${PROJECT}/ \ && chown -R ${PROJECT}:${PROJECT} /etc/${PROJECT} \ && chown root:root /etc/${PROJECT}/policy.json \ + && rm /etc/apache2/ports.conf /etc/apache2/sites-enabled/* /etc/apache2/sites-available/* \ + && touch /etc/apache2/ports.conf \ # Project specific command block end && apt-get purge -y --auto-remove ca-certificates curl git \ && rm -rf /var/lib/apt/lists/* /tmp/* /root/.cache \ diff --git a/dockerfiles/Dockerfile-ubuntu b/dockerfiles/Dockerfile-ubuntu index f0531ae..6a7ffc3 100644 --- a/dockerfiles/Dockerfile-ubuntu +++ b/dockerfiles/Dockerfile-ubuntu @@ -9,10 +9,12 @@ ARG GIT_REF ARG GIT_REF_REPO=https://git.openstack.org/openstack/${PROJECT} RUN set -x \ - && apt-get update \ - && apt-get install -y --no-install-recommends \ + && apt-get update \ + && apt-get install -y --no-install-recommends \ # Project specific packages start - python \ + python \ + apache2 \ + libapache2-mod-wsgi \ # Project specific packages end && apt-get install -y --no-install-recommends ca-certificates curl git \ # common install start @@ -42,10 +44,14 @@ RUN set -x \ && chown ${PROJECT}:${PROJECT} /etc/${PROJECT} /var/log/${PROJECT} /var/lib/${PROJECT} /var/cache/${PROJECT} \ # common install end # Project specific command block start - && pip install --no-cache-dir --no-index --no-compile --find-links /tmp/packages --constraint /tmp/packages/upper-constraints.txt python-memcached pymysql \ + && pip install --no-cache-dir --no-index --no-compile --find-links /tmp/packages --constraint /tmp/packages/upper-constraints.txt \ + python-memcached \ + pymysql \ && cp -rfv /tmp/${PROJECT}/etc/heat/* /etc/${PROJECT}/ \ && chown -R ${PROJECT}:${PROJECT} /etc/${PROJECT} \ && chown root:root /etc/${PROJECT}/policy.json \ + && rm /etc/apache2/ports.conf /etc/apache2/sites-enabled/* /etc/apache2/sites-available/* \ + && touch /etc/apache2/ports.conf \ # Project specific command block end && apt-get purge -y --auto-remove ca-certificates curl git \ && rm -rf /var/lib/apt/lists/* /tmp/* /root/.cache \