2015-09-17 09:35:33 -07:00
|
|
|
FROM {{ namespace }}/{{ image_prefix }}openstack-base:{{ tag }}
|
2015-11-23 12:38:58 +05:30
|
|
|
MAINTAINER {{ maintainer }}
|
2015-08-12 10:38:06 +00:00
|
|
|
|
2016-08-03 13:13:52 +00:00
|
|
|
{% import "macros.j2" as macros with context %}
|
|
|
|
|
2015-08-12 10:38:06 +00:00
|
|
|
{% if install_type == 'binary' %}
|
2015-09-04 02:15:03 -07:00
|
|
|
{% if base_distro in ['centos', 'fedora', 'oraclelinux', 'rhel'] %}
|
2015-08-12 10:38:06 +00:00
|
|
|
|
2016-08-03 13:13:52 +00:00
|
|
|
{% set cinder_base_packages = [
|
|
|
|
'openstack-cinder',
|
|
|
|
'python-automaton',
|
|
|
|
'lvm2',
|
|
|
|
'ceph-common'
|
|
|
|
] %}
|
2015-08-12 10:38:06 +00:00
|
|
|
|
2016-01-12 12:39:44 +01:00
|
|
|
{% elif base_distro in ['ubuntu'] %}
|
|
|
|
|
2016-08-03 13:13:52 +00:00
|
|
|
{% set cinder_base_packages = [
|
|
|
|
'cinder-common',
|
|
|
|
'ceph-common',
|
|
|
|
'lvm2'
|
|
|
|
] %}
|
2016-01-12 12:39:44 +01:00
|
|
|
|
2015-08-12 10:38:06 +00:00
|
|
|
{% endif %}
|
2016-08-03 13:13:52 +00:00
|
|
|
|
2016-08-12 08:24:11 +10:00
|
|
|
{{ macros.install_packages(cinder_base_packages | customizable("packages")) }}
|
2016-08-03 13:13:52 +00:00
|
|
|
|
2015-08-12 10:38:06 +00:00
|
|
|
{% elif install_type == 'source' %}
|
2015-09-04 02:15:03 -07:00
|
|
|
{% if base_distro in ['centos', 'fedora', 'oraclelinux', 'rhel'] %}
|
2015-08-26 01:18:23 -07:00
|
|
|
|
2016-08-03 13:13:52 +00:00
|
|
|
{% set cinder_base_packages = [
|
|
|
|
'lvm2',
|
|
|
|
'qemu-img',
|
|
|
|
'ceph-common'
|
|
|
|
] %}
|
2015-08-26 01:18:23 -07:00
|
|
|
|
|
|
|
{% elif base_distro in ['ubuntu', 'debian'] %}
|
|
|
|
|
2016-08-03 13:13:52 +00:00
|
|
|
{% set cinder_base_packages = [
|
|
|
|
'lvm2',
|
|
|
|
'qemu-utils',
|
|
|
|
'ceph-common'
|
|
|
|
] %}
|
2015-08-26 01:18:23 -07:00
|
|
|
|
|
|
|
{% endif %}
|
2015-08-12 10:38:06 +00:00
|
|
|
|
2016-08-12 08:24:11 +10:00
|
|
|
{{ macros.install_packages(cinder_base_packages | customizable("packages")) }}
|
2016-08-03 13:13:52 +00:00
|
|
|
|
2015-09-02 17:36:46 +03:00
|
|
|
ADD cinder-base-archive /cinder-base-source
|
|
|
|
RUN ln -s cinder-base-source/* cinder \
|
2015-08-12 10:38:06 +00:00
|
|
|
&& useradd --user-group cinder \
|
2015-12-27 02:41:30 +00:00
|
|
|
&& /var/lib/kolla/venv/bin/pip --no-cache-dir install --upgrade -c requirements/upper-constraints.txt /cinder \
|
2016-02-12 14:17:48 +01:00
|
|
|
&& mkdir -p /etc/cinder /var/lib/cinder /home/cinder \
|
2015-08-12 10:38:06 +00:00
|
|
|
&& cp -r /cinder/etc/cinder/* /etc/cinder/ \
|
2016-02-12 14:17:48 +01:00
|
|
|
&& chown -R cinder: /etc/cinder /var/lib/cinder /home/cinder \
|
2016-02-03 05:12:13 +00:00
|
|
|
&& sed -i 's|^exec_dirs.*|exec_dirs=/var/lib/kolla/venv/bin,/sbin,/usr/sbin,/bin,/usr/bin,/usr/local/bin,/usr/local/sbin|g' /etc/cinder/rootwrap.conf
|
2015-08-12 10:38:06 +00:00
|
|
|
|
|
|
|
{% endif %}
|
2015-11-30 10:30:37 +05:30
|
|
|
|
2016-07-02 19:59:44 +08:00
|
|
|
COPY cinder_sudoers /etc/sudoers.d/kolla_cinder_sudoers
|
2016-02-12 14:17:48 +01:00
|
|
|
COPY extend_start.sh /usr/local/bin/kolla_extend_start
|
|
|
|
|
|
|
|
RUN usermod -a -G kolla cinder \
|
2016-08-03 13:13:52 +00:00
|
|
|
&& mkdir -p /etc/ceph \
|
2016-02-12 14:17:48 +01:00
|
|
|
&& chmod 750 /etc/sudoers.d \
|
2016-07-02 19:59:44 +08:00
|
|
|
&& chmod 440 /etc/sudoers.d/kolla_cinder_sudoers \
|
2016-02-24 11:48:06 +01:00
|
|
|
&& touch /usr/local/bin/kolla_cinder_extend_start \
|
|
|
|
&& chmod 755 /usr/local/bin/kolla_extend_start /usr/local/bin/kolla_cinder_extend_start
|
2016-08-03 13:13:52 +00:00
|
|
|
|
|
|
|
{% block cinder_base_footer %}{% endblock %}
|
|
|
|
{% block footer %}{% endblock %}
|