Not able to access Kibana running in a Docker container on port 5601

I have built a docker image with the following Docker file.

# gunicorn-flask                                                                                                                                                                         

FROM devdb/kibana

MAINTAINER John Doe <user.name@gmail.com>

ENV DEBIAN_FRONTEND noninteractive

RUN apt-get update
RUN apt-get install -y python python-pip python-virtualenv gunicorn

# Setup flask application
RUN mkdir -p /deploy/app

COPY gunicorn_config.py /deploy/gunicorn_config.py
COPY app /deploy/app

RUN pip install -r /deploy/app/requirements.txt

WORKDIR /deploy/app

EXPOSE 5000 5601 9200

# Start gunicorn
CMD ["/usr/bin/gunicorn", "--config", "/deploy/gunicorn_config.py", "listener:app"]

I am running the container from the image created from this Docker file as follows.

  • “usermod: UID '0' already exists” why?
  • Docker machine using generic driver: x509: certificate signed by unknown authority when trying to add remote host to local machine
  • missing stack command Docker
  • Record Sound on Ubuntu Docker Image
  • FeignClient call with consul service throws connection refused in docker container
  • Not getting real file update in vm
  • sudo docker run -p 5601:5601 -p 9200:9200 -p 5000:5000 -v /home/Workspace/xits/config/elasticsearch.yml:/opt/elasticsearch/config/elasticsearch.yml -v /home/Workspace/xits/config/kibana.yml:/opt/kibana/config/kibana.yml es-kibana-gunicorn:latest
    

    The issue I am facing is that I cannot access Kibana port 5601 on my host machine. My browser page says ERR_CONNECTION_REFUSED

    I am able to access port 5000 though.

    I can’t figure out why this is.Any help would be greatly appreciated.

  • Referencing a dynamic argument in the Docker Entrypoint
  • docker mysql restoring dump files
  • Docker for Jobs
  • Suse Linux docker file
  • How-to run a node.js docker instance dropping into a shell that is auto-tailing logs
  • Scaling with docker-composer and appending a number to the hostname?
  • One Solution collect form web for “Not able to access Kibana running in a Docker container on port 5601”

    The parent Dockerfile devdb/kibana is using a script to start kibana and elasticsearch when the docker container is started. See CMD ["/sbin/my_init"] and the script itself.

    When in your own Dockerfile you use the CMD instruction, you override the one from the parents Dockerfiles.
    Since your CMD only starts gunicorn, elasticsearch and kibana won’t ever be started. That’s why there is no response on their respective network ports.

    The Docker image you inherits from inherits itself from phusion/baseimage which has its own way of making multiple processes run in Docker containers. I recommend you follow the instructions on their README file to learn how to add your gunicorn to the list of services to start. Basically you would have to define a script named run and add it to your docker image within the /etc/service/<service name>/ directory.

    In your Dockerfile, add:

    COPY run /etc/service/gunicorn/
    

    and the run script should be something similar to:

    #!/bin/bash
    cd /deploy/app
    /usr/bin/gunicorn --config /deploy/gunicorn_config.py listener:app
    
    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.