From 4399eef12c70e3caa6b2c98da7f02d201dbfea11 Mon Sep 17 00:00:00 2001 From: ai-dev Date: Sun, 21 Sep 2025 23:56:26 +0200 Subject: [PATCH] test --- opensearch-master/Dockerfile | 32 ++++++++++++++++++++++++++++---- 1 file changed, 28 insertions(+), 4 deletions(-) diff --git a/opensearch-master/Dockerfile b/opensearch-master/Dockerfile index 11a1d58..54cd00e 100644 --- a/opensearch-master/Dockerfile +++ b/opensearch-master/Dockerfile @@ -1,10 +1,33 @@ ARG BASE_IMAGE=opensearchproject/opensearch:latest FROM ${BASE_IMAGE} -# Install dependencies for configuration (Amazon Linux 2023 uses dnf) -RUN dnf update -y && \ - dnf install -y gettext jq && \ - dnf clean all +# Switch to root user to install packages +USER root + +# Install dependencies for configuration +RUN if command -v dnf >/dev/null 2>&1; then \ + echo "Installing with dnf" && \ + dnf install -y gettext jq && \ + dnf clean all; \ + elif command -v yum >/dev/null 2>&1; then \ + echo "Installing with yum" && \ + yum install -y gettext jq && \ + yum clean all; \ + elif command -v microdnf >/dev/null 2>&1; then \ + echo "Installing with microdnf" && \ + microdnf install -y gettext jq && \ + microdnf clean all; \ + elif command -v apt-get >/dev/null 2>&1; then \ + echo "Installing with apt-get" && \ + apt-get update -y && \ + apt-get install -y gettext-base jq && \ + apt-get clean && \ + rm -rf /var/lib/apt/lists/*; \ + else \ + echo "No package manager found! Checking if envsubst and jq are already available..." && \ + command -v envsubst || echo "envsubst not found" && \ + command -v jq || echo "jq not found"; \ + fi # Copy configuration files and scripts COPY rootfs/ / @@ -14,6 +37,7 @@ RUN mkdir -p /usr/share/opensearch/config/jvm.options.d && \ chown -R opensearch:opensearch /usr/share/opensearch && \ chmod +x /usr/bin/configure-opensearch +# Switch back to opensearch user USER opensearch # Use our custom entrypoint script