# Start optimize process during docker build?

**URL:** <https://discuss.elastic.co/t/start-optimize-process-during-docker-build/173634>\
**Category:** Kibana\
**Created:** [March 24, 2019, 1:06pm UTC](https://discuss.elastic.co/t/start-optimize-process-during-docker-build/173634 "2019-03-24T13:06:50Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![asp](https://avatars.discourse-cdn.com/v4/letter/a/9fc348/32.png) [@asp](https://discuss.elastic.co/u/asp)\
**Post date:** [March 24, 2019, 1:06pm UTC](https://discuss.elastic.co/t/start-optimize-process-during-docker-build/173634/1 "2019-03-24T13:06:50Z")

</div>

Hi,

is here a way to start optimizing step during the build explicitly and stop kibana directly after it is done?

I want to prepare a custom image of kibana docker container. Due to some config changes kibana is runnning the optimizer task on first start of container. That increases the startup time of first run.  
So I want to move this step to image creation process. And kibana should terminate afterwards just like when installing plugins. But not all installations of kibana are using plugins, so I need another way.

Thanks, Andreas

---

<div class="post-metadata">

**Author:** ![bhavyarm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bhavyarm/32/22392_2.png) [@bhavyarm](https://discuss.elastic.co/u/bhavyarm)\
**Post date:** [March 26, 2019, 7:22pm UTC](https://discuss.elastic.co/t/start-optimize-process-during-docker-build/173634/2 "2019-03-26T19:22:24Z")

</div>

@tiagocosta can we please get some help here?

Thanks,  
Bhavya

---

<div class="post-metadata">

**Author:** ![tiagocosta](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tiagocosta/32/40045_2.png) [@tiagocosta](https://discuss.elastic.co/u/tiagocosta)\
**Post date:** [March 26, 2019, 7:38pm UTC](https://discuss.elastic.co/t/start-optimize-process-during-docker-build/173634/3 "2019-03-26T19:38:51Z")

</div>

@asp we did some changes above that matter that were introduced on `6.5.0`.  
Basically you just need to call `./bin/kibana --optimize` when building the docker image to start an optimization during the image creation.

You can found more info about that matter in the original issue [https://github.com/elastic/kibana/issues/6057](https://github.com/elastic/kibana/issues/6057) and in the related pull request: [https://github.com/elastic/kibana/pull/16302](https://github.com/elastic/kibana/pull/16302)

Cheers,  
Tiago

---

<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:** [April 23, 2019, 7:38pm UTC](https://discuss.elastic.co/t/start-optimize-process-during-docker-build/173634/4 "2019-04-23T19:38:53Z")

</div>

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