sscarduzio / elasticsearch-readonlyrest-plugin

Free Elasticsearch security plugin and Kibana security plugin: super-easy Kibana multi-tenancy, Encryption, Authentication, Authorization, Auditing

Home Page:https://readonlyrest.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error while installing ror plugin inside docker container

hsachan22 opened this issue · comments

I am trying to install readonlyrest plugin for elasticsearch inside docker container, but i am getting an error while building the image.

Error

 => ERROR [4/4] RUN jdk/bin/java -jar plugins/readonlyrest/ror-tools.jar patch                        0.8s
------
 > [4/4] RUN jdk/bin/java -jar plugins/readonlyrest/ror-tools.jar patch:
0.646 Checking if Elasticsearch is patched ...
0.647 Creating backup ...
0.672 Patching ...
0.742 UNEXPECTED ERROR: null

Dockerfile

FROM docker.elastic.co/elasticsearch/elasticsearch:8.5.1

ENV ES_VERSION=8.5.1

COPY ./elasticsearch.yml config/

RUN bin/elasticsearch-plugin install -b "https://api.beshu.tech/download/es?esVersion=${ES_VERSION}"
RUN jdk/bin/java -jar plugins/readonlyrest/ror-tools.jar patch

ENTRYPOINT [ "bin/elasticsearch" ]

Can anyone help me resolve this issue?

please try this:

FROM docker.elastic.co/elasticsearch/elasticsearch:8.5.2

ENV ES_VERSION=8.5.2

COPY ./elasticsearch.yml config/

RUN bin/elasticsearch-plugin install -b "https://api.beshu.tech/download/es?esVersion=${ES_VERSION}"

USER root
RUN jdk/bin/java -jar plugins/readonlyrest/ror-tools.jar patch
USER elasticsearch

ENTRYPOINT [ "bin/elasticsearch" ]

⚠️IMPORTANT: for Elasticsearch 8.3.x or newer, the patching operation requires root user privileges.
https://docs.readonlyrest.com/elasticsearch#3.-patch-elasticsearch

Thanks, it worked.