Skip to content

Commit

Permalink
refactor: Dockerfile improvements for OpenSearch image (#205)
Browse files Browse the repository at this point in the history
* fix: fixed some local error occurances for docker build

* Update Dockerfile

---------

Co-authored-by: SlavomirMazurPantheon <67378888+SlavomirMazurPantheon@users.noreply.github.com>
  • Loading branch information
dmytro-kyrychenko and SlavomirMazurPantheon authored Sep 18, 2023
1 parent bd63a36 commit 9d1fa97
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions opensearch/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
FROM opensearchproject/opensearch:2.7.0
ARG OPENSEARCH_ID
ARG OPENSEARCH_GID
ENV OPENSEARCH_ID "$OPENSEARCH_ID"
ENV OPENSEARCH_GID "$OPENSEARCH_GID"

ENV VIRTUAL_ENV=/opensearch
ENV OPENSEARCH_ID="$OPENSEARCH_ID" \
OPENSEARCH_GID="$OPENSEARCH_GID" \
VIRTUAL_ENV=/opensearch

COPY opensearch.yml /usr/share/opensearch/config/
COPY thesaurus.conf /usr/share/opensearch/config/
COPY jvm.options /usr/share/opensearch/config/
COPY opensearch.yml thesaurus.conf jvm.options /usr/share/opensearch/config/

USER root:root
RUN usermod -u ${OPENSEARCH_ID} opensearch
RUN groupmod -g ${OPENSEARCH_GID} opensearch
RUN chown -R opensearch:root /usr/share/opensearch/config/
RUN usermod -u ${OPENSEARCH_ID} opensearch \
&& groupmod -g ${OPENSEARCH_GID} opensearch \
&& chown -R ${OPENSEARCH_ID}:${OPENSEARCH_GID} /usr/share/opensearch/

# Support arbitrary UIDs as per OpenShift guidelines
USER ${OPENSEARCH_ID}:${OPENSEARCH_GID}

Expand Down

0 comments on commit 9d1fa97

Please sign in to comment.