How to start kibana from docker


#1

Hi, I want to develop kibana from docker and the kibana source code(adding some plugins and change some source code) and try to write a dockerfile to start it.

I have a server running elasticsearch. However, when I run the image it always stop at the "optimization success" and only a few times can start normally.

I run the kibana on this command : docker run -e "ELASTICSEARCH_URL= [server ip address]" [kibana image name]

Can anyone give me some advice? Thank you!


#2

Hi @bamboo2222,

What docker image exactly you use and what is your OS?

Also what you mean by it always stop at the "optimization success"?

Thanks,
Oleg


#3

Thanks for the reply. :slight_smile:
I'm running my program on Win10, and build the docker image from the source code of kibana 6.2.4.
And when I run kibana, the last two logs are:

{"type":"log","@timestamp":"2018-07-10T08:13:48Z","tags":["info","optimize"],"pid":32,"bundles":["sense-tests","kibana","stateSessionStorageRedirect","status_page","timelion"],"status":"success","seconds":"57.03","message":"Optimization success in 57.03 seconds"}
{"type":"log","@timestamp":"2018-07-10T08:13:53Z","tags":["info","optimize"],"pid":32,"bundles":["sense-tests","kibana","stateSessionStorageRedirect","status_page","timelion"],"status":"success","seconds":"2.97","message":"Optimization success in 2.97 seconds"}

And it always stop here and no other logs display. When I try to access "localhost:5601", there is no connection.


#4

Ah, you're not using official docker image?

And it always stop here and no other logs display.

That sounds correct, you shouldn't see anything else until you start interacting with Kibana. Are you sure you've exposed 5601 port from docker container (like here)?

Best,
Oleg


#6

Yes, I think I do expose 5601 port.
My dockerfile is like this,

FROM node
RUN set -x
&& git clone --branch v6.2.4 https://github.com/elastic/kibana.git
&& cd kibana
#automatically delete container files when stopped
&& rm -rf .git
&& npm install
&& sed -ri "s!^(#\s*)?(server.host:).*!\2 '0.0.0.0'!" /kibana/config/kibana.yml
&& grep -q "^server.host: '0.0.0.0'$" /kibana/config/kibana.yml \

&& sed -ri "s!^(#\s*)?(elasticsearch.url:).*!\2 'http://elasticsearch.url:9200'!" /kibana/config/kibana.yml
&& grep -q "^elasticsearch.url: 'http://elasticsearch:9200'$" /kibana/config/kibana.yml
EXPOSE 5601
WORKDIR /kibana
VOLUME /kibana/plugins
CMD ["npm", "start"]

One more question, if I want to change the source code and add plugins to kibana, can I use the official docker image to achieve this? Thanks!


#7

INAL, but generally you can do whatever license permits, there are two of them used in Kibana, see Image Types for more details and also license for Docker image itself.

And We Opened X-Pack may be interesting to you too :slight_smile:

Best,
Oleg


#8

Thanks ! :slight_smile:


(system) #9

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