# Create a Custom Docker Image

**URL:** <https://discuss.elastic.co/t/create-a-custom-docker-image/150765>\
**Category:** Kibana\
**Created:** [October 2, 2018, 8:27pm UTC](https://discuss.elastic.co/t/create-a-custom-docker-image/150765 "2018-10-02T20:27:38Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![titan1978](https://avatars.discourse-cdn.com/v4/letter/t/c37758/32.png) [@titan1978](https://discuss.elastic.co/u/titan1978)\
**Post date:** [October 2, 2018, 8:27pm UTC](https://discuss.elastic.co/t/create-a-custom-docker-image/150765/1 "2018-10-02T20:27:38Z")

</div>

I was looking at [this](https://discuss.elastic.co/t/how-to-do-custom-docker-image-that-has-certain-features-disabled/132007) very informative post to create a custom kibana image.

However, there's a small twist in our requirements. As part of the build process when we are trying to install our plugin it requires these two to be set. However during the install - we get this failure:

```
process.env.KYROS_PLUGIN_ENV_TYPE: undefined
process.env.KYROS_REGION: undefined

```

The following is the docker file. Am passing the build args successfully to the Dockerfile. Everything works fine until the plugin install step which fails giving the above failure which is plugin requires. When I remove the final plugin install step and bash into the image (to debug), I noticed there is no /etc/default/kibana.  
How can I set these process.env variables so that the build step succeeds?

```
FROM artifactory.semperfi.com/alpha/kibana:6.3.0
MAINTAINER James spader
USER root
ARG KYROS_PLUGIN_ENV_TYPE
ARG KYROS_REGION
COPY kibana.yml /usr/share/kibana/config/kibana.yml
RUN echo "The Plugin Environment Type : $KYROS_PLUGIN_ENV_TYPE"
RUN echo "The Plugin default Region : $KYROS_REGION"
RUN echo "KYROS_PLUGIN_ENV_TYPE=$KYROS_PLUGIN_ENV_TYPE" >> /etc/default/kibana
RUN echo "KYROS_REGION=$KYROS_REGION" >> /etc/default/kibana
COPY kyros_plugin.zip .
RUN ./bin/kibana-plugin install file://${PWD}/kyros_plugin.zip

```

PS:  
_When I try to mimic installing Kibana regularly in an EC2 Instance (not using docker) but use RPM Install to install kibana and set the KYROS environments - I see the /etc/default/kibana created and after setting the above two variables in there : the plugin install step succeeds. It feels like in the DOCKER method, kibana-plugin install doesnt recognize the contents /etc/default/kibana_

---

<div class="post-metadata">

**Author:** ![rashmi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rashmi/32/16391_2.png) [@rashmi](https://discuss.elastic.co/u/rashmi)\
**Post date:** [October 4, 2018, 2:33am UTC](https://discuss.elastic.co/t/create-a-custom-docker-image/150765/2 "2018-10-04T02:33:12Z")

</div>

pinging @jarpy for further explanation.

Thanks  
Rashmi

---

<div class="post-metadata">

**Author:** ![titan1978](https://avatars.discourse-cdn.com/v4/letter/t/c37758/32.png) [@titan1978](https://discuss.elastic.co/u/titan1978)\
**Post date:** [October 4, 2018, 2:37am UTC](https://discuss.elastic.co/t/create-a-custom-docker-image/150765/3 "2018-10-04T02:37:18Z")

</div>

@rashmi Thanks - I figured this out. Add these lines fixed it. I have a different problem now while installing plugins (optimizing browser bundles that doesn't end).

```
ENV KYROS_PLUGIN_ENV_TYPE= $KYROS_PLUGIN_ENV_TYPE
ENV KYROS_REGION=$KYROS_REGION
```

---

<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:** [November 1, 2018, 2:37am UTC](https://discuss.elastic.co/t/create-a-custom-docker-image/150765/4 "2018-11-01T02:37:24Z")

</div>

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