0

I need to make modifications in Kibana interface, like changing the logo etc. To do this, I need to make modifications in it's docker image that I am using. What would be the right approach? How do I rebuild this modified image?

I have tried to pull a fresh image and work on it. But the modifications don't show on the interface.

ShilpaT
  • 1
  • 4

2 Answers2

0

Simply use docker commit or try to build extended image with Dockerfile.

Konrad
  • 952
  • 10
  • 25
  • 1
    `docker commit` is not a reproducible path and you should basically never use it. (There is a newer Kibana patch release; how do you apply the exact same changes on top of that newer base image?) – David Maze Mar 27 '19 at 15:25
  • I am newbie to Docker, so the simpleton approach I tried was: 1. Finding the folder where Kibana image is stored. 2. Make modifications. 3. This is to be determined, what next? – ShilpaT Mar 27 '19 at 15:38
  • @DavidMaze you are right. I will make up to extending image using Dockerfile. – Konrad Mar 27 '19 at 15:47
0

There's two basic good approaches to this, depending on how much customization you need to do.

If you're just replacing config files and injecting alternate images, you can use Docker bind mounts to do this. A typical Docker Compose file to do this might look like (I'm making up paths a little bit):

version: '3'
services:
  kibana:
    image: 'kibana:6.6.2'
    volumes:
      - ./kibana.yml:/etc/kibana/kibana.yml
      - ./kibana.png:/usr/share/kibana/assets/kibana.png

You can then check this docker-compose.yml, the config file, and anything else you're injecting this way into source control. These files replace the corresponding files from the image in the specified paths. (And if the container process happens to write to these files, the host files will change too.)

If you need to make somewhat more involved changes, building a custom image makes sense. (The official Docker tutorial on building and running custom images is helpful, if more application-oriented.) You can start an image FROM any other image. The equivalent Dockerfile to the above might look like

FROM kibana:6.6.2
COPY kibana.yml /etc/kibana
COPY kibana.png /usr/share/kibana/assets
# Keep base image's ENTRYPOINT/CMD

and the matching docker-compose.yml file could just be

version: '3'
services:
  kibana:
    build: .

Both of these approaches put you in a position where you can check everything that went into the image/container into source control, and on the off chance that your system dies (or a new colleague is trying the project, or /var/lib/docker gets corrupted, or Amazon shuts off your EC2 instances, or ...) you can just check the artifacts out of source control and run them again. If you need a newer version of Kibana, you can just change the image tag and re-run things as well.

David Maze
  • 130,717
  • 29
  • 175
  • 215