Docker docker-compose Custom Kibana

I just wanted to give back to the community as it took me quite a few hours to get to this point of a custom Kibana running in Docker that can be redeployed with out loosing your changes..
1st copy your files from the running docker onto the host that you will be customizing. I have my system in AWS and my host has a mounted EFS drive that is shared among all my instances.

docker cp containerid:/usr/share/kibana/plugins/x-pack/plugins/security/public/views/login/login.less /efs/kibana/login.less 
docker cp containerid:/usr/share/kibana/src/ui/public/chrome/directives/global_nav/global_nav_link/global_nav_link.less /efs/kibana/global_nav_link.less
docker cp containerid:/usr/share/kibana/src/ui/public/chrome/directives/global_nav/global_nav.less /efs/kibana/global_nav.less
docker cp containerid:/usr/share/kibana/src/ui/views/chrome.jade /efs/kibana/chrome.jade

There are many other posts on how to customize the colors from these files.

Here is my docker-compose

version: "3"

services:
  kibanatest:
    image: docker.elastic.co/kibana/kibana:5.6.1
    container_name: test-5.6.1
    deploy:
      restart_policy:
        condition: on-failure
        delay: 5s
        max_attempts: 3
        window: 120s
    volumes:
       - ./plugins/kibana-time-plugin:/usr/share/kibana/plugins/kibana-time-plugin:rw
       - /efs/hvms:/efs/hvms:rw
       - /efs/kibana/kibana.svg:/usr/share/kibana/src/ui/public/images/kibana.svg:rw
       - /efs/kibana/kibana.png:/usr/share/kibana/src/ui/public/images/kibana.png:rw
       - /efs/kibana/chrome.jade:/usr/share/kibana/src/ui/views/chrome.jade:rw
       - /efs/kibana/global_nav.less:/usr/share/kibana/src/ui/public/chrome/directives/global_nav/global_nav.less:rw
       - /efs/kibana/global_nav_link.less:/usr/share/kibana/src/ui/public/chrome/directives/global_nav/global_nav_link/global_nav_link.less:rw
       - /efs/kibana/login.less:/usr/share/kibana/plugins/x-pack/plugins/security/public/views/login/login.less:rw
    environment:
      ELASTICSEARCH_URL: https://xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.us-west-2.aws.found.io:9243
      ELASTICSEARCH_USERNAME: elastic
      ELASTICSEARCH_PASSWORD: xxxxxxxxxxxxxxxxxxxxxx
      KIBANA_INDEX: .kibana-test
      LOGGING_DEST: /efs/hvms/live/kibana_test.log
      OPS_INTERVAL: 60000
    ports:
      - "80:5601"
  kibanabi:
    image: docker.elastic.co/kibana/kibana:5.6.1
    container_name: bi-5.6.1
    deploy:
      restart_policy:
        condition: on-failure
        delay: 5s
        max_attempts: 3
        window: 120s
    volumes:
       - ./plugins/kibana-time-plugin:/usr/share/kibana/plugins/kibana-time-plugin:rw
       - /efs/hvms:/efs/hvms:rw
       - /efs/kibana/kibana.svg:/usr/share/kibana/src/ui/public/images/kibana.svg:rw
       - /efs/kibana/kibana.png:/usr/share/kibana/src/ui/public/images/kibana.png:rw
       - /efs/kibana/chrome.jade:/usr/share/kibana/src/ui/views/chrome.jade:rw
       - /efs/kibana/global_nav.less:/usr/share/kibana/src/ui/public/chrome/directives/global_nav/global_nav.less:rw
       - /efs/kibana/global_nav_link.less:/usr/share/kibana/src/ui/public/chrome/directives/global_nav/global_nav_link/global_nav_link.less:rw
       - /efs/kibana/login.less:/usr/share/kibana/plugins/x-pack/plugins/security/public/views/login/login.less:rw
    environment:
      ELASTICSEARCH_URL: https://xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.us-west-2.aws.found.io:9243
      ELASTICSEARCH_USERNAME: elastic
      ELASTICSEARCH_PASSWORD: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
      XPACK_GRAPH_ENABLED: "false"
      XPACK_MONITORING_ENABLED: "false"
      XPACK_REPORTING_ENABLED: "false"
      XPACK_SECURITY_ENABLED: "true"
      XPACK_ML.ENABLED: "false"
      KIBANA_INDEX: .kibana-bi
      SERVER_DEFAULTROUTE: /app/kibana#/dashboard/7bdc16b0-702d-11e7-88dc-0d54ae3f1f7e?embed=true
      LOGGING_DEST: /efs/hvms/live/kibana_bi.log
      OPS_INTERVAL: 60000
    ports:
      - "10000:5601"

As you can see I also have a plugin that brought into the containers but the files are on the host..
Hope this helps others out. It took alot of googling to put this all together.

1 Like

Acknowledging your post. Will be marking this as fixed.

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