This commit is contained in:
ai-dev
2025-09-21 23:56:26 +02:00
parent 635ae8fac3
commit 4399eef12c

View File

@@ -1,10 +1,33 @@
ARG BASE_IMAGE=opensearchproject/opensearch:latest ARG BASE_IMAGE=opensearchproject/opensearch:latest
FROM ${BASE_IMAGE} FROM ${BASE_IMAGE}
# Install dependencies for configuration (Amazon Linux 2023 uses dnf) # Switch to root user to install packages
RUN dnf update -y && \ USER root
dnf install -y gettext jq && \
dnf clean all # 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 configuration files and scripts
COPY rootfs/ / COPY rootfs/ /
@@ -14,6 +37,7 @@ RUN mkdir -p /usr/share/opensearch/config/jvm.options.d && \
chown -R opensearch:opensearch /usr/share/opensearch && \ chown -R opensearch:opensearch /usr/share/opensearch && \
chmod +x /usr/bin/configure-opensearch chmod +x /usr/bin/configure-opensearch
# Switch back to opensearch user
USER opensearch USER opensearch
# Use our custom entrypoint script # Use our custom entrypoint script