Skip to content

Add extensionpoint to docker-entrypoint.sh #86

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed

Add extensionpoint to docker-entrypoint.sh #86

wants to merge 1 commit into from

Conversation

sebglon
Copy link

@sebglon sebglon commented Mar 3, 2016

Add scan folder docker-entrypoint-initels.d to extend container before every start up CMD
show #85

Add scan folder docker-entrypoint-initels.d to extend container before every start up CMD 
show #85
@czerasz
Copy link

czerasz commented May 20, 2016

This would be very useful. For example for adding templates or creating indexes with a specific mapping.

@tianon
Copy link
Member

tianon commented Jul 5, 2016

I think the discussion in docker-library/mongo#53 is very relevant here.

@tianon
Copy link
Member

tianon commented Jul 6, 2016

Arg, I linked to the wrong discussion, sorry. 😞

Relevant comments/discussion:

@yosifkit
Copy link
Member

yosifkit commented Jul 7, 2016

My thought for this one specifically is why not just end my custom script with exec /docker-entrypoint.sh elasticsearch and then run my container with the following:

$ docker run -d -v /custom/script.sh:/custom-script.sh elasticsearch /custom-script.sh

The only thing we miss inheriting from the entrypoint into our script is the chown beforehand and the stepdown from root, which could be a bonus. If we really want to not be root, we can just add --user elasticsearch to the docker run and we get basically the same setup as the PR.

The reason I bring this up is that docker-entrypoint-initdb.d exists in images like postgres to let you do things that can only be done after the database files are initialized and while the database is running. Whereas I don't see that in this PR, since elasticsearch is not running and doesn't require initialization.

For example, I can do the following and have my plugin in the resulting image:

FROM elasticsearch
RUN plugin -i elasticsearch/marvel/latest

@mi-hol
Copy link

mi-hol commented Dec 22, 2016

@sebglon I wonder if @yosifkit proposed solution solved your issue? In case it did this could be closed :)

@zerthimon
Copy link

So, what @yosifkit proposed actually works well.
I've made this little custom script to install x-pack

#!/bin/bash

# install x-pack if not yet installed
if ! bin/elasticsearch-plugin list | grep -qs x-pack; then
   yes | bin/elasticsearch-plugin install x-pack
fi

# run elastic
exec /docker-entrypoint.sh elasticsearch "$@"

@kdh6429
Copy link

kdh6429 commented Feb 27, 2017

I would like to set templates from docker-compose, and to do this, it require elasticsearch running. Therefore I think this merge is still necessary to do like setting template or index.

@yosifkit
Copy link
Member

yosifkit commented May 8, 2017

Closing since the repo is being deprecated. See discussion on #160 for more information.

This image is officially deprecated in favor of the elasticsearch image provided by elastic.co which is available to pull via docker.elastic.co/elasticsearch/elasticsearch:[version] like 5.2.1. This image will receive no further updates after 2017-06-20 (June 20, 2017). Please adjust your usage accordingly.

Elastic provides open-source support for Elasticsearch via the elastic/elasticsearch GitHub repository and the Docker image via the elastic/elasticsearch-docker GitHub repository, as well as community support via its forums.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants