Skip to content
Snippets Groups Projects
Commit a8661dea authored by Swapnil Kulkarni (coolsvap)'s avatar Swapnil Kulkarni (coolsvap)
Browse files

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
parent 917b4df0
No related branches found
No related tags found
No related merge requests found
...@@ -14,3 +14,5 @@ COPY extend_start.sh /usr/local/bin/kolla_extend_start ...@@ -14,3 +14,5 @@ COPY extend_start.sh /usr/local/bin/kolla_extend_start
RUN chmod 755 /usr/local/bin/kolla_extend_start RUN chmod 755 /usr/local/bin/kolla_extend_start
{{ include_footer }} {{ include_footer }}
USER cinder
...@@ -4,6 +4,6 @@ set -o errexit ...@@ -4,6 +4,6 @@ set -o errexit
# Bootstrap and exit if KOLLA_BOOTSTRAP variable is set. This catches all cases # Bootstrap and exit if KOLLA_BOOTSTRAP variable is set. This catches all cases
# of the KOLLA_BOOTSTRAP variable being set, including empty. # of the KOLLA_BOOTSTRAP variable being set, including empty.
if [[ "${!KOLLA_BOOTSTRAP[@]}" ]]; then if [[ "${!KOLLA_BOOTSTRAP[@]}" ]]; then
sudo -H -u cinder cinder-manage db sync cinder-manage db sync
exit 0 exit 0
fi fi
...@@ -2,3 +2,5 @@ FROM {{ namespace }}/{{ image_prefix }}cinder-base:{{ tag }} ...@@ -2,3 +2,5 @@ FROM {{ namespace }}/{{ image_prefix }}cinder-base:{{ tag }}
MAINTAINER {{ maintainer }} MAINTAINER {{ maintainer }}
{{ include_footer }} {{ include_footer }}
USER cinder
...@@ -37,3 +37,5 @@ RUN ln -s cinder-base-source/* cinder \ ...@@ -37,3 +37,5 @@ RUN ln -s cinder-base-source/* cinder \
&& chown -R cinder: /etc/cinder /var/log/cinder /home/cinder && chown -R cinder: /etc/cinder /var/log/cinder /home/cinder
{% endif %} {% endif %}
RUN usermod -a -G kolla cinder
...@@ -2,3 +2,5 @@ FROM {{ namespace }}/{{ image_prefix }}cinder-base:{{ tag }} ...@@ -2,3 +2,5 @@ FROM {{ namespace }}/{{ image_prefix }}cinder-base:{{ tag }}
MAINTAINER {{ maintainer }} MAINTAINER {{ maintainer }}
{{ include_footer }} {{ include_footer }}
USER cinder
...@@ -13,3 +13,5 @@ RUN yum install -y \ ...@@ -13,3 +13,5 @@ RUN yum install -y \
{% endif %} {% endif %}
{{ include_footer }} {{ include_footer }}
USER cinder
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment