3

I forked the keen/dashboards github repo and I am trying to create a Dockerfile for running the dashboard in a Docker container.

My fork: https://github.com/adityai/dashboards

I am not familiar with node and npm. The Docker image was built successfully.

https://hub.docker.com/r/adityai/dashboards/

I am not sure if I am using the right command to start the dashboards app (npm start) because when I try to run the docker container locally, it does not start. It exits right away.

docker run -d -p 3000:3000 --name=keen-dashboard adityai/dashboards:gh-pages

1 Answers1

4

Like you did: clone the repo

$ git clone https://github.com/adityai/dashboards.git

This repo does contain a Dockerfile (which is a file which describes the setup of your docker image). You can build a docker image from the file

$ cd dashboards
$ docker build -t my-dashboard .

The dockerfile starts from base image httpd (apache). After the build of your dockerfile you can see your image:

$ docker images
REPOSITORY          TAG                 IMAGE ID            CREATED              SIZE
my-dashboard        latest              81a5607c03ba        About a minute ago   204 MB

And you can create a container instance from that image. I must admit there is not much info about the docker run command on the github page or docker hub page.

Now you can run the image. I saw that port 80 was exposed in the dockerfile so I mapped port 80 of the container on port 80 of my local machine.

$ docker run -d -p 80:80 my-dashboard

Now I can visit the dashboards in my browser at localhost:80 enter image description here

lvthillo
  • 28,263
  • 13
  • 94
  • 127