Skip to content
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

Use depends_on dependency container #78

Merged
merged 5 commits into from
Nov 19, 2016

Conversation

nathaliaortegaGL
Copy link
Contributor

add depends_on to kibana and logstash on docker-compose.yml to prevent having to install NC and not have to keep checking for ES to start as the container will start after.

@deviantony
Copy link
Owner

Oh this looks really nice !! Did you try it? Are you sure that the kibana service will be able to detect that the elasticsearch is ready to listen on port 9200 ?

As stated in docker-compose docs: https://docs.docker.com/compose/compose-file/#/dependson

Note: depends_on will not wait for db and redis to be “ready” before starting web - only until they have been started.

Maybe Kibana 5 now have a better support to re-establish connections to elasticsearch though... I need to try this :)

@quentinfayet
Copy link

quentinfayet commented Nov 4, 2016

@deviantony @nathaliaortegaGL I'm currently using depends_on on a custom docker ELK stack, and everything works just fine. Kibana service waits quietly for Elasticsearch to be up and running.

@nathaliaortegaGL
Copy link
Contributor Author

@deviantony yes, I tried it and it works fine! :)

Copy link
Owner

@deviantony deviantony left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey ! Thanks again for the PR and sorry for my late review.

I just tested it, it works perfectly well ! It seems that Elastic managed to make logstash/kibana try to reconnect on the elasticsearch instance insteadd of shutting down.

As said in the comments, the script kibana/entrypoint.sh is now useless. We'll keep the kibana/Dockerfile with only the base image import as it may be used later to extend it easily.

I've also tested without the depends_on directives and it works too ! But we'll keep them as it make things clearer about the dependencies of the stack.

@@ -1,7 +1,5 @@
FROM kibana:5

RUN apt-get update && apt-get install -y netcat bzip2

COPY entrypoint.sh /tmp/entrypoint.sh
Copy link
Owner

@deviantony deviantony Nov 11, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can also remove the lines 3-4 which are used to copy the entrypoint.sh script. This script has no purposes anymore, so please delete it too. We'll keep the kibana/Dockerfile with only the FROM directive.

@@ -1,10 +1,4 @@
#!/usr/bin/env bash

# Wait for the Elasticsearch container to be ready before starting Kibana.
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As said previously, delete the file kibana/entrypoint.sh.

@deviantony
Copy link
Owner

ping @nathaliaortegaGL

@krainboltgreene
Copy link

depends_on will (1.10) eventually use HEALTHCHECK to determine if it's actually ready, which is nice, but any "it works in correct order" here is chance.

@deviantony
Copy link
Owner

Yeap, this is indeed a good PR. Another ping @nathaliaortegaGL ?

@ernestova
Copy link

I just ping @nathaliaortegaGL internally to update her PR.

@nathaliaortegaGL
Copy link
Contributor Author

@deviantony changes have been applied!

Copy link
Owner

@deviantony deviantony left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One last update required.


COPY entrypoint.sh /tmp/entrypoint.sh
RUN chmod +x /tmp/entrypoint.sh

CMD ["/tmp/entrypoint.sh"]
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You also need to remove this line, otherwise it won't work.

@deviantony
Copy link
Owner

@nathaliaortegaGL one more thing needs to be updated.

@nathaliaortegaGL
Copy link
Contributor Author

@deviantony Sorry, forgot to delete that :) It's ready now.

@deviantony deviantony merged commit 63a7750 into deviantony:master Nov 19, 2016
@deviantony
Copy link
Owner

Thanks @nathaliaortegaGL :)

herpiko pushed a commit to herpiko/docker-elk that referenced this pull request Jun 9, 2019
DanBrown47 pushed a commit to DanBrown47/docker-elk that referenced this pull request Jun 22, 2023
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.

None yet

5 participants