Elasticsearch docker-entrypoint.sh script overwrite

Hi,

I need to run few commands when container starts, so I would like add those commands in docker-entrypoint.sh script.

I am using Elasticsearch version 7.9.2, I tried to create the cluster without adding my custom commands in the docker-entrypoint.sh script but it is failing and if I don't specify the entry point it is creating cluster. I need to mention entrypoint as I would need to run few commands.

Here is my docker file,

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

ENTRYPOINT ["/usr/local/bin/docker-entrypoint.sh"]

CMD ["eswrapper"]

Error message
java.lang.RuntimeException: can not run elasticsearch as root
at org.elasticsearch.bootstrap.Bootstrap.initializeNatives(Bootstrap.java:111)
at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:178)
at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:393)
at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:170)
at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:161)
at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:86)
at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:127)
at org.elasticsearch.cli.Command.main(Command.java:90)
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:126)

Copied the docker-entrypoint.sh content from here

Please help me out why it is failing

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.