0

I am running windows 10, using docker for windows.

Here's the baseline:

docker pull nshou/elasticsearch-kibana:kibana3
docker image list
docker run -d -p 9200:9200 -p 5601:5601 {imageName}:kibana3
curl localhost:9200/_stats

Good response.

So I copied the Dockerfile from https://bitbucket.org/nshou/elasticsearch-kibana/src/kibana3/Dockerfile

FROM ubuntu:latest    
RUN apt-get update -q  
RUN apt-get install -yq wget default-jre-headless mini-httpd

ENV ES_VERSION 1.7.4    
RUN cd /tmp && \
    wget -nv https://download.elastic.co/elasticsearch/elasticsearch/elasticsearch-${ES_VERSION}.tar.gz && \
    tar zxf elasticsearch-${ES_VERSION}.tar.gz && \
    rm -f elasticsearch-${ES_VERSION}.tar.gz && \
    mv /tmp/elasticsearch-${ES_VERSION} /elasticsearch

ENV KIBANA_VERSION 3.1.3   
RUN cd /tmp && \
    wget -nv https://download.elastic.co/kibana/kibana/kibana-${KIBANA_VERSION}.tar.gz && \
    tar zxf kibana-${KIBANA_VERSION}.tar.gz && \
    rm -f kibana-${KIBANA_VERSION}.tar.gz && \
    mv /tmp/kibana-${KIBANA_VERSION} /kibana

CMD /elasticsearch/bin/elasticsearch -Des.http.cors.enabled=true -Des.logger.level=OFF & mini_httpd -d /kibana -h `hostname` -r -D -p 5601

EXPOSE 9200 5601

and I build it with

docker build -t test/test .

Image builds successfully.

docker image list
docker run -d -p 9200:9200 -p 5601:5601 {imageName}:latest
curl localhost:9200/_stats

No response. Not a 404, but the server responds with a no response.

The problem seems to be that when I build the image myself it doesn't work. When I pull the same dockerfile image from the hub, it works.

Why and how do I fix it?

RGroppa
  • 325
  • 2
  • 13
  • 1
    Presumably you're using `nshou/elasticsearch-kibana` as the value for `${imageName}` on the first `docker run` and `test/test` on the second. It's possible that the Dockerfile you have does not match the Dockerfile that was used to generate the container image. There are no local dependencies in the Dockerfile so your plan ought to work. Perhaps try again using `docker run --interactive --tty ...` and drop the `-d` or `docker logs ...` to get more information from the container? FYI: `test/test` maps to `docker.io/test/test` which probably isn't a repository that you own. – DazWilkin Jun 23 '19 at 01:48
  • This is great advice! By examining the container interactively I was able to catch and confirm the jre issue. Just switched to jre 8 and now it works. Still strange the baseline worked though. – RGroppa Jun 23 '19 at 03:58

1 Answers1

0

Figured it out. When the locally built container is running, its actually crashing with this error

Unrecognized VM option 'UseParNewGC' , Error: Could not create the Java Virtual Machine

The default-jre-headless is using a version of Java that is incompatible with this older version of Elasticsearch.

Switching to openjdk-8-jre-headless solves the issue.

I guess the image on nshou is cached and so old that it's using an older version of the jre? I'm not sure why the baseline image would work when the latest default-jre-headless has this issue with the kibana3 tag of the repo.

Thankfully my problem is resolved.

RGroppa
  • 325
  • 2
  • 13