kolla-ansible/docker_templates/keystone/Dockerfile.j2
Sam Yaple 17333aed12 Fix keystone for Ubuntu
Due to the differences between Ubuntu and Centos around Apache2 I have
had to copy both start.sh and config-external.sh to be unique files
for Ubuntu so as not to affect Centos either. This can be removed when
we change the way config-external works.

Change-Id: I14dc11e7bb6284b897259a53acc914ae8f254d3c
Partially-Implements: blueprint install-from-ubuntu
2015-08-23 06:07:04 +00:00

71 lines
2.1 KiB
Django/Jinja

FROM {{ namespace }}/{{ base_distro }}-{{ install_type }}-base:{{ tag }}
MAINTAINER Kolla Project (https://launchpad.net/kolla)
{% if install_type == 'binary' %}
{% if base_distro in ['fedora', 'centos', 'oraclelinux'] %}
RUN yum -y install openstack-keystone \
python-keystoneclient \
python-openstackclient \
httpd \
mod_wsgi \
&& yum clean all
RUN mkdir -p /var/www/cgi-bin/keystone \
&& cp -a /usr/share/keystone/keystone.wsgi /var/www/cgi-bin/keystone/main \
&& cp -a /usr/share/keystone/keystone.wsgi /var/www/cgi-bin/keystone/admin
{% elif base_distro in ['ubuntu', 'debian'] %}
RUN apt-get install -y --no-install-recommends \
apache2 \
keystone \
libapache2-mod-wsgi \
python-keystoneclient \
&& apt-get clean
RUN ln -s /etc/apache2/sites-available/wsgi-keystone.conf /etc/apache2/sites-enabled \
&& mkdir -p /var/www/cgi-bin/keystone \
&& cp -a /usr/share/keystone/wsgi.py /var/www/cgi-bin/keystone/main \
&& cp -a /usr/share/keystone/wsgi.py /var/www/cgi-bin/keystone/admin
{% endif %}
{% elif install_type == 'source' %}
{% if base_distro in ['fedora', 'centos', 'oraclelinux'] %}
RUN yum -y install \
httpd \
mod_wsgi \
&& yum clean all
{% elif base_distro in ['ubuntu', 'debian'] %}
RUN apt-get install -y --no-install-recommends \
apache2 \
libapache2-mod-wsgi \
&& apt-get clean
{% endif %}
ADD ./keystone.tar /
RUN ln -s /keystone-* /keystone
RUN cd /keystone \
&& useradd --user-group keystone \
&& pip install -r requirements.txt \
&& pip install --install-option="--install-scripts=/usr/bin" /keystone \
&& mkdir -p /etc/keystone /var/www/cgi-bin/keystone /var/log/apache2 /home/keystone \
&& cp -r /keystone/etc/* /etc/keystone/ \
&& cp -a httpd/keystone.py /var/www/cgi-bin/keystone/admin \
&& cp -a httpd/keystone.py /var/www/cgi-bin/keystone/main
{% endif %}
RUN chown -R keystone: /var/www/cgi-bin/keystone \
&& chmod 755 /var/www/cgi-bin/keystone/*
COPY start.sh /
COPY config-external.sh /opt/kolla/
CMD ["/start.sh"]