Drop root for cinder

Updates to ensure commands run in the cinder containers
are done as the 'cinder' user rather than root.

Change-Id: Ibbe04e3a92195dfb957fa56f762c60a80dbe30ca
Partially-Implements: blueprint drop-root
This commit is contained in:
Swapnil Kulkarni (coolsvap) 2015-11-30 10:30:37 +05:30
parent 917b4df01e
commit a8661deac6
6 changed files with 11 additions and 1 deletions

View File

@ -14,3 +14,5 @@ COPY extend_start.sh /usr/local/bin/kolla_extend_start
RUN chmod 755 /usr/local/bin/kolla_extend_start
{{ include_footer }}
USER cinder

View File

@ -4,6 +4,6 @@ set -o errexit
# 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
sudo -H -u cinder cinder-manage db sync
cinder-manage db sync
exit 0
fi

View File

@ -2,3 +2,5 @@ FROM {{ namespace }}/{{ image_prefix }}cinder-base:{{ tag }}
MAINTAINER {{ maintainer }}
{{ include_footer }}
USER cinder

View File

@ -37,3 +37,5 @@ RUN ln -s cinder-base-source/* cinder \
&& chown -R cinder: /etc/cinder /var/log/cinder /home/cinder
{% endif %}
RUN usermod -a -G kolla cinder

View File

@ -2,3 +2,5 @@ FROM {{ namespace }}/{{ image_prefix }}cinder-base:{{ tag }}
MAINTAINER {{ maintainer }}
{{ include_footer }}
USER cinder

View File

@ -13,3 +13,5 @@ RUN yum install -y \
{% endif %}
{{ include_footer }}
USER cinder