From 8cdfa5c00e205635e28f401b8f8c88e560dd133a Mon Sep 17 00:00:00 2001 From: Michal Nasiadka Date: Tue, 16 Apr 2024 13:10:47 +0200 Subject: [PATCH] Fix OpenSearch file ownership issues Since 2.13 OpenSearch and OpenSearch-Dashboards packages install files in /usr/share/opensearch and /usr/share/opensearch-dashboards with root:root ownership instead of using opensearch/opensearch-dashboards user. Closes-Bug: #2061877 Change-Id: I3831d8ab76c8c7136ce7869db3d0d1e05b4ba8f8 (cherry picked from commit 7c098bdd3cac73505851d4c97d7f39e966f00e1b) --- docker/opensearch/opensearch-dashboards/Dockerfile.j2 | 2 ++ docker/opensearch/opensearch/Dockerfile.j2 | 2 ++ 2 files changed, 4 insertions(+) diff --git a/docker/opensearch/opensearch-dashboards/Dockerfile.j2 b/docker/opensearch/opensearch-dashboards/Dockerfile.j2 index 83677474a3..a4bbd29f44 100644 --- a/docker/opensearch/opensearch-dashboards/Dockerfile.j2 +++ b/docker/opensearch/opensearch-dashboards/Dockerfile.j2 @@ -14,6 +14,8 @@ LABEL maintainer="{{ maintainer }}" name="{{ image_name }}" build-date="{{ build {{ macros.install_packages(opensearch_dashboards_packages | customizable("packages")) }} +RUN chown -R opensearch-dashboards:opensearch-dashboards /usr/share/opensearch-dashboards + COPY extend_start.sh /usr/local/bin/kolla_extend_start RUN chmod 755 /usr/local/bin/kolla_extend_start diff --git a/docker/opensearch/opensearch/Dockerfile.j2 b/docker/opensearch/opensearch/Dockerfile.j2 index 891c1f7e64..196cf675bf 100644 --- a/docker/opensearch/opensearch/Dockerfile.j2 +++ b/docker/opensearch/opensearch/Dockerfile.j2 @@ -18,6 +18,8 @@ ENV OPENSEARCH_INITIAL_ADMIN_PASSWORD="Kolla24OpenSearch" {{ macros.install_packages(opensearch_packages | customizable("packages")) }} +RUN chown -R opensearch:opensearch /usr/share/opensearch + COPY extend_start.sh /usr/local/bin/kolla_extend_start RUN chmod 755 /usr/local/bin/kolla_extend_start