'Fluentd container not running on Openshift

I am trying to run the fluentd image on Openshift. I am using the official image of Fluentd from Docker Hub for the same.

However, i get the following error -

adduser: permission denied (are you root?)
chown: unknown user fluent
chown: unknown user fluent
su-exec: setgroups(0): Operation not permitted

I think this is because the Fluentd container wants to run as root, while Openshift doesn't allow containers that want to run as root.

Does anybody know how I can fix this problem? Run the Fluentd container as a non-root user? Thanks in advance for any help.

The URL of the repo is - https://hub.docker.com/r/fluent/fluentd/



Solution 1:[1]

We had the same issue in our Project. We solved this building a custom fluentd container based on the fluentd-onbuild image, which is designed to customize the base fluentd container. The Dockerfile is located here:

https://github.com/Gepardec/Hogarama/blob/master/Fluentd/Dockerfile

https://github.com/Gepardec/Hogarama/blob/0f91618c37493ef70eb5d83bcec3bd258edc29c3/Fluentd/Dockerfile

The project also contains openshift templates, which may contain some snippets you can use to adapt it to your needs:

https://github.com/Gepardec/Hogarama/tree/master/Templates

https://github.com/Gepardec/Hogarama/tree/0f91618c37493ef70eb5d83bcec3bd258edc29c3/Templates

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1