# Create Custom Build image for customized kibana 6.4.3 source code

**URL:** <https://discuss.elastic.co/t/create-custom-build-image-for-customized-kibana-6-4-3-source-code/192104>\
**Category:** Kibana\
**Tags:** docker\
**Created:** [July 24, 2019, 5:49pm UTC](https://discuss.elastic.co/t/create-custom-build-image-for-customized-kibana-6-4-3-source-code/192104 "2019-07-24T17:49:21Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![vishal\_M](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vishal_m/32/50559_2.png) [@vishal\_M](https://discuss.elastic.co/u/vishal_M)\
**Post date:** [July 24, 2019, 5:49pm UTC](https://discuss.elastic.co/t/create-custom-build-image-for-customized-kibana-6-4-3-source-code/192104/1 "2019-07-24T17:49:21Z")

</div>

Hello Team,

I am trying to create docker image with some customized kibana source code. So that, i can deploy it in a kubernetes cluster.

Here are the steps i followed so far.

- Cloned kibana dev source code ([GitHub - elastic/kibana: Your window into the Elastic Stack](https://github.com/elastic/kibana)).
- Made a Checkout 6.4.3 version into my local MacOS machine.
- Customized kibana source code. // made changes in one file (filter\_bar.less)
- changed Node version 8.11.4
- Yarn Install
- yarn kbn bootstrap
- yarn start
- Yarn build ---\> (6 packages were generated into the kibana/target directory for darwin, linux, winows versions and some OSS versions (zip files) )
- Extracted darwin and windows versions and tested them using in mac and windows using run/kibana and works as expected.

And as per Jarpy's instructions in this below POST

> [@Custom Docker Image for custom Kibana Source](https://discuss.elastic.co/t/custom-docker-image-for-custom-kibana-source/159163/6):
>
> OK, cool. Here's what I did for version 6.4.4: Cloned the Kibana repository to /home/jarpy/src/kibana Checked out the 6.4 branch Built Kibana with: nvm install nvm use yarn kbn bootstrap yarn build --skip-os-packages --release Cloned the [kibana-docker](https://github.com/elastic/kibana-docker) repository Checked out the 6.4 branch Built the images with: env ARTIFACTS\_DIR=/home/jarpy/src/ ELASTIC\_VERSION=6.4.4 make release-manager-release

I have cloned kibana-docker 6.4.3 ( [GitHub - elastic/kibana-docker at 6.4](https://github.com/elastic/kibana-docker/tree/6.4) )into my local machine.  
Also, i have installed virtualenv, Python docker in my local machine.

I know there is no need to create a docker file by myself to create a docker image. Please can you provide me steps editing the docker template (make file or docker related files under template folder) for generating the docker image using my local source code of kibana/target along with the commands.

FYI:I am pretty new to docker .

Thanks in advance and any help is highly appreciated.

---

<div class="post-metadata">

**Author:** ![Brandon\_Kobel](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/brandon_kobel/32/14829_2.png) [@Brandon\_Kobel](https://discuss.elastic.co/u/Brandon_Kobel)\
**Post date:** [July 24, 2019, 9:21pm UTC](https://discuss.elastic.co/t/create-custom-build-image-for-customized-kibana-6-4-3-source-code/192104/2 "2019-07-24T21:21:03Z")

</div>

Did you run the equivalent of this command substituting the `ARTIFACTS_DIR` path to be relative to your cloned kibana repo?

> ARTIFACTS\_DIR=/home/jarpy/src/ ELASTIC\_VERSION=6.4.4 make release-manager-release

---

<div class="post-metadata">

**Author:** ![vishal\_M](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vishal_m/32/50559_2.png) [@vishal\_M](https://discuss.elastic.co/u/vishal_M)\
**Post date:** [July 29, 2019, 12:55pm UTC](https://discuss.elastic.co/t/create-custom-build-image-for-customized-kibana-6-4-3-source-code/192104/5 "2019-07-29T12:55:21Z")

</div>

Thanks for your reply Brandon,  
i tried running  
env ARTIFACTS\_DIR=/Users/vmacha012/Documents/Project/PluginDev/kibana **(My local source code PATH)****appending with ELASTIC\_VERSION=6.4.3 make release-manager-release**. but, it's throwing few errors  
make[1]: \*\*\* [build-from-local-artifacts] Error 127  
make: \*\*\* [release-manager-release] Error 2

And can see newly generated **(Dockerfile-full & Docker -oss)** files under **/kibana-docker/build/kibana**. Please can you refer to the screenshots.

 ![39%20AM](https://us1.discourse-cdn.com/elastic/original/3X/2/4/2432378c67edf1981868b72417f2e83cbe10f0bd.png)

---

<div class="post-metadata">

**Author:** ![vishal\_M](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vishal_m/32/50559_2.png) [@vishal\_M](https://discuss.elastic.co/u/vishal_M)\
**Post date:** [July 29, 2019, 1:00pm UTC](https://discuss.elastic.co/t/create-custom-build-image-for-customized-kibana-6-4-3-source-code/192104/6 "2019-07-29T13:00:30Z")

</div>

And when i tried running it as build image. It took nearly 5 mins to **"sending build context to docker deamon"** and it got failed in 5th step .. Please refer to snapshot 1 (It is due to the tar.gz file)

 ![ScreenShot_1](https://us1.discourse-cdn.com/elastic/original/3X/0/9/0993a10c61829641865fa084a00762cf7b0b4dc8.png)

and when i tried uncompressing the file and changing the relative path in generated docker file and triggered a build ...it got exited with non-zero code:7 (Please refer to the attached screenshot 2  
And the next command didn't run (I mean from step6 to Step 15)

 ![Screen_Shot_2](https://us1.discourse-cdn.com/elastic/original/3X/c/0/c0c86b72ca87405d1671328bfba2b385dd1a5d13.png)

Can some one help me in building the docker-image asap. As i have to move it to production environment early next week

Below is the file that got generated when i run env ARTIFACTS\_DIR=/Users/vmacha012/Documents/Project/PluginDev/kibana ELASTIC\_VERSION=6.4.3 make release-manager-release:slight\_smile:

 ![47%20PM](https://us1.discourse-cdn.com/elastic/original/3X/4/4/4415e0de6bd06a36c026246c8f0df236e077ffbb.png)

---

<div class="post-metadata">

**Author:** ![Brandon\_Kobel](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/brandon_kobel/32/14829_2.png) [@Brandon\_Kobel](https://discuss.elastic.co/u/Brandon_Kobel)\
**Post date:** [July 29, 2019, 5:31pm UTC](https://discuss.elastic.co/t/create-custom-build-image-for-customized-kibana-6-4-3-source-code/192104/7 "2019-07-29T17:31:45Z")

</div>

@vishal_M, using `curl` against `localhost` isn't going to work. From the containers perspective, `localhost` is the container itself. You shouldn't need to modify the `Dockerfile` and you should just be able to specify the `ARCHIVES_DIR` environment variable as originally recommended by jarpy.

---

<div class="post-metadata">

**Author:** ![vishal\_M](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vishal_m/32/50559_2.png) [@vishal\_M](https://discuss.elastic.co/u/vishal_M)\
**Post date:** [July 29, 2019, 5:35pm UTC](https://discuss.elastic.co/t/create-custom-build-image-for-customized-kibana-6-4-3-source-code/192104/9 "2019-07-29T17:35:44Z")

</div>

Hello Brandon, I have used the below command to generate docker file.

env ARTIFACTS\_DIR=/Users/vmacha012/Documents/Project/PluginDev/kibana ELASTIC\_VERSION=6.4.3 make release-manager-release

I am using an auto-generated docker file to build the image. I haven't updated any line ([http://localhost:8000](http://localhost:8000/))..

I have a question: Do i need to checkin my customized code to Kibana source code repository([https://github.com/elastic/kibana](https://github.com/elastic/kibana)) by creating a new branch along with the target folder ?

---

<div class="post-metadata">

**Author:** ![Brandon\_Kobel](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/brandon_kobel/32/14829_2.png) [@Brandon\_Kobel](https://discuss.elastic.co/u/Brandon_Kobel)\
**Post date:** [July 29, 2019, 6:22pm UTC](https://discuss.elastic.co/t/create-custom-build-image-for-customized-kibana-6-4-3-source-code/192104/10 "2019-07-29T18:22:12Z")

</div>

@vishal_M, apologies I didn't realize that the old generated Dockerfile from [https://github.com/elastic/kibana-docker/tree/6.4](https://github.com/elastic/kibana-docker/tree/6.4) is using curl in this manner.

From `/Users/vmacha012/Documents/Project/PluginDev/` if you run `python -m SimpleHTTPServer` it will host a simple web server which will allow you to use curl from within the Dockerfile.

---

<div class="post-metadata">

**Author:** ![vishal\_M](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vishal_m/32/50559_2.png) [@vishal\_M](https://discuss.elastic.co/u/vishal_M)\
**Post date:** [July 29, 2019, 7:08pm UTC](https://discuss.elastic.co/t/create-custom-build-image-for-customized-kibana-6-4-3-source-code/192104/12 "2019-07-29T19:08:57Z")

</div>

Hello Brandon,  
Just now, i have realized that the files that have generated under (kibana source code) kibana/target folder has a different name ( [kibana-6.4.3-SNAPSHOT-linux-x86\_64.tar.gz]). But, in the docker file it is generated as [http://localhost:8000/kibana/target/kibana-6.4.3-linux-x86\_64.tar.gz](http://localhost:8000/kibana/target/kibana-6.4.3-linux-x86_64.tar.gz) . Please refer to the attached snapshot (Left-top).  
I have started running the web server using `python -m SimpleHTTPServer` as per your instructions and can accessible the files using url:(plz refer to the right side of the snapshot).  
FYI : I have tried to build image by renaming [http://localhost:8000/kibana/target/kibana-6.4.3-SNAPSHOT-linux-x86\_64.tar.gz](http://localhost:8000/kibana/target/kibana-6.4.3-SNAPSHOT-linux-x86_64.tar.gz) in the docker file. But, still there seems to be the same issue(left-bottom).

 ![17%20PM](https://us1.discourse-cdn.com/elastic/original/3X/a/b/abdf97d3266bf4991c5c4bb667335e10dd7debe5.png)

---

<div class="post-metadata">

**Author:** ![Brandon\_Kobel](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/brandon_kobel/32/14829_2.png) [@Brandon\_Kobel](https://discuss.elastic.co/u/Brandon_Kobel)\
**Post date:** [July 29, 2019, 7:47pm UTC](https://discuss.elastic.co/t/create-custom-build-image-for-customized-kibana-6-4-3-source-code/192104/13 "2019-07-29T19:47:42Z")

</div>

You're running `docker build` directly instead of using the Makefile. The Makefile does some rather complex logic [https://github.com/elastic/kibana-docker/blob/907a9be2a38bea7e833e2f3d4557251780aaf6e4/Makefile#L67-L79](https://github.com/elastic/kibana-docker/blob/907a9be2a38bea7e833e2f3d4557251780aaf6e4/Makefile#L67-L79). I'd recommend instead renaming your `/kibana/target/*.tar.gz` to match the expected files, or augmenting the `kibana-docker/templates/Dockerfile.j2` to work with your existing archive naming.

---

<div class="post-metadata">

**Author:** ![vishal\_M](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vishal_m/32/50559_2.png) [@vishal\_M](https://discuss.elastic.co/u/vishal_M)\
**Post date:** [July 29, 2019, 9:11pm UTC](https://discuss.elastic.co/t/create-custom-build-image-for-customized-kibana-6-4-3-source-code/192104/15 "2019-07-29T21:11:34Z")

</div>

@Brandon_Kobel ,  
I believe, Make file will be first entry point that triggers when we hit ('make release-manager-release' ) it will generate us a docker file with ([https://artifacts.elastic.co/downloads/kibana/kibana-6.4.3-linux-x86\_64.tar.gz](https://artifacts.elastic.co/downloads/kibana/kibana-6.4.3-linux-x86_64.tar.gz) ) and seems to be successfully built (plz refer snapshot 1).

 ![41%20AM](https://us1.discourse-cdn.com/elastic/original/3X/d/1/d19d12a1ef70a3e0ac6a90f2c6d3435e90016131.png)

When we provide ARTIFACTS\_DIR , it will generate us a docker file with localpath of our source code (kibana/docker ) this is where it is throwing errors. (plz refer snapshot 2)

 ![54%20PM](https://us1.discourse-cdn.com/elastic/original/3X/f/b/fb27d1483d07cc441440627302ebb5123bd535d6.png) .

---

<div class="post-metadata">

**Author:** ![vishal\_M](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vishal_m/32/50559_2.png) [@vishal\_M](https://discuss.elastic.co/u/vishal_M)\
**Post date:** [July 30, 2019, 5:35pm UTC](https://discuss.elastic.co/t/create-custom-build-image-for-customized-kibana-6-4-3-source-code/192104/16 "2019-07-30T17:35:14Z")

</div>

@Brandon_Kobel , can you please clone this repos and try the instructions which were in my first post (install dependencies, yarn kbn bootstrap, build)

1. [https://github.com/elastic/kibana/tree/6.4](https://github.com/elastic/kibana/tree/6.4)  
2.[https://github.com/elastic/kibana-docker/tree/6.4](https://github.com/elastic/kibana-docker/tree/6.4) and see if you are also facing the same issue.

Else can you pull-in @jarpy . So that, i can request him to look into this asap..

Here is the complete post: [Create Custom Build image for customized kibana 6.4.3 source code](https://discuss.elastic.co/t/create-custom-build-image-for-customized-kibana-6-4-3-source-code/192104/13)

Thank you very much!!

---

<div class="post-metadata">

**Author:** ![jarpy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jarpy/32/51290_2.png) [@jarpy](https://discuss.elastic.co/u/jarpy)\
**Post date:** [July 31, 2019, 12:03am UTC](https://discuss.elastic.co/t/create-custom-build-image-for-customized-kibana-6-4-3-source-code/192104/17 "2019-07-31T00:03:01Z")

</div>

Hi Vishal,

I can't see the command you ran. Please send a complete transcript from the shell, as a [GitHub Gist](http://gist.gitghub.com). Screenshots of shells are hard to read, impossible to search and tend to omit details.

Also, is there any chance of using Kibana 7? It has a completely different Docker build system that is integrated with the main source code.

---

<div class="post-metadata">

**Author:** ![vishal\_M](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vishal_m/32/50559_2.png) [@vishal\_M](https://discuss.elastic.co/u/vishal_M)\
**Post date:** [July 31, 2019, 4:32pm UTC](https://discuss.elastic.co/t/create-custom-build-image-for-customized-kibana-6-4-3-source-code/192104/19 "2019-07-31T16:32:52Z")

</div>

Hello @jarpy && @Brandon_Kobel ,  
I have tried creating kibana docker-image for version 6.4.3. Please find the attached gist url let me know if you have any issues.

I have run a web-server in my local machine using this command : python -m SimpleHTTPServer  
[https://gist.github.com/vishal-macha/bce7df5fc062b4ce0ef768a17a94259b](https://gist.github.com/vishal-macha/bce7df5fc062b4ce0ef768a17a94259b) .

we tried to deploy as kibana docker image7.1.1 .But, its has some issues with kubernetes cluster.

Also, We tried customizing kibana source code 7.0.0 and deploy it as a docker image. It also has a similar issue ( like generating custom docker image with kibana source code 6.4.3)(didn't tried deploying a basic kibana 7.1.1 image from elastic artifacts in kubernetes).

We were able to deploy 6.4.3 in kubernetes cluser successfully. So ended up customizing kibana source code 6.4.3. But, facing issues while trying to generate a custom docker image.

Any help is highly appreciated.

---

<div class="post-metadata">

**Author:** ![vishal\_M](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vishal_m/32/50559_2.png) [@vishal\_M](https://discuss.elastic.co/u/vishal_M)\
**Post date:** [August 6, 2019, 1:49pm UTC](https://discuss.elastic.co/t/create-custom-build-image-for-customized-kibana-6-4-3-source-code/192104/20 "2019-08-06T13:49:00Z")

</div>

Hello @jarpy & @Brandon_Kobel ,  
Please can someone look into this gist and provide me the instructions on how to generate custom docker image successfully.

> <https://gist.github.com/vishal-macha/bce7df5fc062b4ce0ef768a17a94259b>

Also, Please let me know if you require any additional information.  
Any help is highly appreciated.

---

<div class="post-metadata">

**Author:** ![Brandon\_Kobel](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/brandon_kobel/32/14829_2.png) [@Brandon\_Kobel](https://discuss.elastic.co/u/Brandon_Kobel)\
**Post date:** [August 6, 2019, 9:06pm UTC](https://discuss.elastic.co/t/create-custom-build-image-for-customized-kibana-6-4-3-source-code/192104/21 "2019-08-06T21:06:58Z")

</div>

@vishal_M your ARTIFACTS\_DIR is incorrect, it should be `ARTIFACTS_DIR=/Users/vmacha012/Documents/Project/Docker/`. Also before running `make release-manager-release` try doing a `docker pull python:3`.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [September 3, 2019, 9:07pm UTC](https://discuss.elastic.co/t/create-custom-build-image-for-customized-kibana-6-4-3-source-code/192104/22 "2019-09-03T21:07:13Z")

</div>

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