fluent / fluent-plugin-mongo

MongoDB input and output plugin for Fluentd
https://docs.fluentd.org/output/mongo
173 stars 61 forks source link

Fluentd mongodb docker #128

Closed johnfg2610 closed 5 years ago

johnfg2610 commented 5 years ago

Could anyone help me setup fluentd, mongodb and docker because i have tried as below and it doesnt seem to work at all, and im not sure why.

docker file

FROM fluent/fluentd
USER root
RUN ["gem", "install", "fluent-plugin-elasticsearch"]
RUN fluent-gem install fluent-plugin-mongo

output

Step 4/4 : RUN fluent-gem install fluent-plugin-mongo
 ---> Running in 6c3e25b9d6e7
Building native extensions. This could take a while...
ERROR:  Error installing fluent-plugin-mongo:
    ERROR: Failed to build gem native extension.

    current directory: /usr/lib/ruby/gems/2.5.0/gems/bson-4.5.0/ext/bson
/usr/bin/ruby -r ./siteconf20190814-1-scnjuu.rb extconf.rb
mkmf.rb can't find header files for ruby at /usr/lib/ruby/include/ruby.h

extconf failed, exit code 1

Gem files will remain installed in /usr/lib/ruby/gems/2.5.0/gems/bson-4.5.0 for inspection.
Results logged to /usr/lib/ruby/gems/2.5.0/extensions/x86_64-linux/2.5.0/bson-4.5.0/gem_make.out
Service 'fluentd' failed to build: The command '/bin/sh -c fluent-gem install fluent-plugin-mongo' returned a non-zero code: 1
Failed to deploy 'Compose: docker-compose.yml': `docker-compose` process finished with exit code 1
ganmacs commented 5 years ago

see https://github.com/fluent/fluentd-docker-image/issues/22