Hi, I'm relatively new to Docker, and I would like to make a custom docker image of Kibana based on the official one, docker.elastic.co/kibana/kibana:6.2.4
, that includes Canvas. My Dockerfile looks like:
FROM docker.elastic.co/kibana/kibana:6.2.4
RUN NODE_OPTIONS="--max-old-space-size=4096" ./bin/kibana-plugin install \
https://download.elastic.co/kibana/canvas/kibana-canvas-0.1.1949.zip
That's working nicely, but I'm still trying to take this a little bit further:
- Install canvas-extras plugin from a zip file
- Disable some unused x-pack features, such as graph and reporting
[1]. To enable part 1, I've created a build of canvas-extras and I'm copying the build file into my docker image, and trying to install the zip with kibana-plugin install
~/elastic-canvas/kibana-extra/canvas-extras(master|✔) % yarn run build
yarn run v1.6.0
$ plugin-helpers build
? What version of Kibana are you building for? 6.2.4
✨ Done in 8.53s.
mv build/canvas-extras-0.4.0.zip ~/elastic/elastic-stack-docker/kibana
Then I add the following to my Dockerfile:
COPY canvas-extras*.zip .
RUN NODE_OPTIONS="--max-old-space-size=4096" ./bin/kibana-plugin install \
file://${PWD}/$(ls canvas-extras*.zip)
Now, when I build, canvas-extras takes quite a long time to "Optimize and cache browser bundles" but eventually it exits with an error code:
Attempting to transfer from file:///usr/share/kibana/canvas-extras-0.4.0.zip
Transferring 9050519 bytes....................
Transfer complete
Retrieving metadata from plugin archive
Extracting plugin archive
Extraction complete
Optimizing and caching browser bundles...
The command '/bin/sh -c NODE_OPTIONS="--max-old-space-size=4096" ./bin/kibana-plugin install file://${PWD}/$(ls canvas-extras*.zip)' returned a non-zero code: 137
Am I right that returned a non-zero code: 137
means that kibana-plugin ran out of memory? I have given Docker 4G in Docker for Mac preferences, and I'm using the --max-old-space-size
option whenever I install a plugin. Thinking that memory is the problem, I figure I probably need to disable some features of x-pack so that less code is re-bundled when plugin installer optimizes. That gets me to [2].
[2]. To disable some features of x-pack that I don't expect to use, I add some ENV
lines to my Dockerfile. The entire file now looks like:
FROM docker.elastic.co/kibana/kibana:6.2.4
ENV XPACK_REPORTING_ENABLED false
ENV XPACK_GRAPH_ENABLED false
RUN NODE_OPTIONS="--max-old-space-size=4096" ./bin/kibana-plugin install \
https://download.elastic.co/kibana/canvas/kibana-canvas-0.1.1949.zip
COPY canvas-extras*.zip .
RUN NODE_OPTIONS="--max-old-space-size=4096" ./bin/kibana-plugin install \
file://${PWD}/$(ls canvas-extras*.zip)
Still, this leads to kibana-plugin install
exiting with code 137
. It really doesn't even seem to matter if I keep the canvas-extras
plugin with the ENV
lines in place. Say I comment out the last 3 lines of the Dockerfile and only have Canvas installed, the plugin installer exits with that error code.
So, does adding ENV
to disable a UI feature in Kibana actually incur MORE memory usage by the plugin installer? Or am I doing something wrong here?