Problem in Running kibana as non-root user in Docker

I am trying to run Kibana 5.5.1 as non-root user in docker. Container is starting but i am getting error as

Is there any way i can run my Kibana container as non-root user. My user is kibanauser.
I am attaching my Dockerfile snippet
dock

Thank you

Hi @Diksha_Rawat,

the error messages indicate that your user kibanauser can not write to the directories /var/run and /var/log/kibana due to them not existing or the user not having sufficient permissions. You could change that in your Dockerfile.

Alternatively you could consider to use the official docker images, that run Kibana as a non-root user as well. If the prebuilt images don't match your requirements you might be able to adapt them and build them yourself using https://github.com/elastic/kibana-docker/.

Hi @weltenwort
Thank you for your reply. I made changes to my Dockerfile as shown below

i gave all permissions to kibanauser still it's not working.kib

Could you please tell me what else i can add to my Dockerfile.
Is 5.5.1 is not compatible with non-root user?

Thank you

I see you are using an init script to start Kibana. This script is not designed to be run as the root process in a docker container. Kibana is run as non-root in the official docker image, so I would recommend to either use that. Alternatively you can try to take some inspiration from the official kibana-docker repo and the main wrapper script in particular.

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