kolla-ansible/docker/glance/glance-base/Dockerfile.j2
Paul Bourke 988c4f23f1 Fix issues in Glance filesystem backend
The drop root change for Glance highlighted the fact that we were
binding volumes from glance_data into the wrong container - it was
glance_registry whereas it should be glance_api. This would result in
all images being lost if the glance_api container happens to restart.

Also, we need a sudoers file to chown the file backend dir to the glance
user.

Change-Id: If04337045bb94b3126e48d1f5bf0ea29e20373ae
Closes-Bug: #1516729
2015-11-17 09:42:39 +00:00

52 lines
1.4 KiB
Django/Jinja

FROM {{ namespace }}/{{ image_prefix }}openstack-base:{{ tag }}
MAINTAINER Kolla Project (https://launchpad.net/kolla)
{% if install_type == 'binary' %}
{% if base_distro in ['centos', 'fedora', 'oraclelinux', 'rhel'] %}
RUN yum -y install \
openstack-glance \
python-oslo-i18n \
python-castellan \
python-cryptography \
python-rbd \
python-rados \
&& yum clean all \
&& mkdir -p /etc/ceph/
{% endif %}
{% elif install_type == 'source' %}
{% if base_distro in ['centos', 'fedora', 'oraclelinux', 'rhel'] %}
RUN yum -y install \
python-rbd \
python-rados \
&& yum clean all \
&& mkdir -p /etc/ceph/
{% elif base_distro in ['ubuntu', 'debian'] %}
RUN apt-get install -y --no-install-recommends \
python-rbd \
python-rados \
&& apt-get clean \
&& mkdir -p /etc/ceph/
{% endif %}
ADD glance-base-archive /glance-base-source
RUN ln -s glance-base-source/* glance \
&& useradd --user-group glance \
&& pip --no-cache-dir install -c requirements/upper-constraints.txt /glance \
&& mkdir -p /etc/glance /var/log/glance /home/glance \
&& cp -r /glance/etc/* /etc/glance/ \
&& chown -R glance: /etc/glance /var/log/glance /home/glance
{% endif %}
COPY glance_sudoers /etc/sudoers.d/glance_sudoers
RUN usermod -a -G kolla glance \
&& chmod 750 /etc/sudoers.d \
&& chmod 440 /etc/sudoers.d/glance_sudoers