Issue running Telegraf in docker desktop - complete noob

Hi, just to preface this with the fact that I am a completely new to docker and docker desktop.

I have successfully got a HiveMQ and InfluxDB containers running in docker desktop and I would like to add Telegraf, I made a pull on the latest but when I try to run the container I get the following errors.

2024-11-04 19:00:22 2024-11-04T19:00:22Z I! Loading config: /etc/telegraf/telegraf.conf
2024-11-04 19:00:22 2024-11-04T19:00:22Z E! [telegraf] Error running agent: no outputs found, probably invalid config file provided

So as I stated I am new with docker and I can not work out how to specify a config file before the container is even running.

Any help appreciated.

Hi, have you mounted the volume?
telegraf’s config file originally located /etc/telegraf.
So if you mount /etc/telegraf to some directory, this directory should have telegraf.conf before run telegraf container.
Look for config sample, brew one, name it telegraf.conf, and place in the directory where you mounted /etc/telegraf.
If you have config file already, check if it has [[outputs.influxdb]] plugin. this plugin directs telegraf where to find your influxdb.