Want to use Elasticsearch as a base image

I want to use elasticsearch app as a base image and load a json file while booting up the ES instance.
Can I do this?
What will be the Entrypoint to start the container?

I think it's this one:

BUT: why not using docker compose instead?

So you just use the normal image and when it's ready to run, run another container which do some curl calls...

1 Like

Want to use a single container only.
Basically What I am trying to do is this:-
Using elasticsearch as base image and then passing a json file inside the container in order to boot the elasticsearch with the json data index.

Why do you want to use a single container? The "loader" container should run only for few seconds. What's the value of adding another step within the Elasticsearch service?

I need to run a python script for loading a json file data in ES while it's booting up.
So that, I can have the ES instance running with preloaded index.

Yes but this does not answer my question.
But anyway. I gave you I believe the script which is called by the docker image.

Maybe I won't be able to explain you that.
But since you understood the usecase, Is it possible for me to do this in same container?
Otherwise using docker-compose is the obvious solution that can work.

I don't know. May be by modifying the docker-entrypoint.sh but I'm really unsure on how this would work. You would need to change last line, make it a daemon and wait until the service is ready to load your documents and then wait forever to make sure the container does not stop...

But honestly I don't know if this will work.

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