Create a Custom Docker Image

I was looking at this 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

pinging @jarpy for further explanation.

Thanks
Rashmi

@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

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