Comments (8)
This might be a crazy idea, but is there a way we could add either as a feature in the dockerfile or a feature to telegraf to attempt an install of uninstalled tools? Maybe add it as an optional feature that is enabled in the docker version.
If telegraf could say, "I'm on debian, let me try to install the tool automatically with apt-get" then that would solve this issue and it seems like an optional feature that could be added to certain plugins. That way, I could just say, "Enable automatic installation through an environment variable" and a user wouldn't have to worry about adding an extra layer unless they wanted more efficiency through layer caching.
How difficult would that be to add to the plugin interface, advertise it, and then tell people to contribute to plugins for auto installation?
from influxdata-docker.
I wouldn't be opposed to the idea @ackstorm23 suggested, where an environment variable could trigger docker run to install dependencies before running telegraf, but I wouldn't want this to be part of telegraf itself. What do you think about this idea @gianarb?
from influxdata-docker.
Hello
It looks a good approach, probably we can use a bash script as a command:
CMD ["./entrypoint.sh"]
The entrypoint.sh
is executed every run, it means that we can check OS and install what we need. We can also set envars or change the arguments that we use to configure influxd
.
The bad point here is only the time required to run
a container, it depends on the complexity of the entrypoint.sh
script.
from influxdata-docker.
Would it solve your problem if instead of adding this tool to the image, you created a new layer on top of the image with the ipmi tools?
See also #11
from influxdata-docker.
That may work, though you will continue to find users who are looking to have not have to create their own layers to make it work. They want telegraf (and it's featureset) to "just work".
Based on the influxdb docker, I was hoping there would be similar intent where you can specify
" -e INFLUXDB_GRAPHITE_ENABLED=true" to enable a normally disabled part of the application.
https://hub.docker.com/_/influxdb/
Would it not also be possible to add "TELEGRAF_IPMI_SENSOR_ENABLED=false" as a default, and allow users to opt-in with =true? This would be a big time saver for anyone looking to use the docker image with the IPMI plugin, no fuss.
If you dont opt-in, the package is skipped, keeping the docker image compact.
If you dont want to manage the remote retrieval of IPMI then allow us to specify "TELEGRAF_IPMITOOL_PKG_URL=http://whatever" and we can update it ourselves if the package url changes.
from influxdata-docker.
I am assuming the InfluxDB option simply enables the service within the configuration file. Are you suggesting that part of the docker run step would include fetching and installing the ipmi tools before starting Telegraf?
One thing to keep in mind is that many plugins require external tools, and it is probably not feasible to provide support for all of them.
from influxdata-docker.
You can effectively add the installation steps inside the entrypoint.sh
shell but this has the following shortcomings:
- each time the container is recreated, the install could pick up a different version of the plugin. Hence for repeatability this is not best.
- after a container creation, it will takes several seconds (more likely minutes) in order to install the plugins and before telegraf is actually run. Users might be surprised.
- Adding that many steps which could fail (no internet connection, etc.) before telegraf is actually run could give a wrong impression of the quality of telegraf to users
I understand that the easiest it is the better sometimes, but in this case I'm more a proponent of good documentation which would tell users: if you want to use ping, ntp, ipmi, etc. you need to install the dependencies iputils-ping, ntp, ipmi_sensor, etc. respectively. And show users how to do it, example (for ntp + ping inputs plugins):
FROM telegraf:1.4.0
RUN apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ntp iputils-ping \
&& apt-get clean -q \
&& rm -Rf /var/lib/apt/lists/*
Currently that my setup at home. I have a small GitLab CI job which builds automatically for me the image each time I change the base image. And I can trigger an Ansible role which does the deployment on my machines. Example Ansible:
- name: (re-)Create telegraf container
become: true
docker_container:
detach: yes
image: "gitlab-registry.lan.berthon.eu/infra/services/telegraf:{{ ansible_date_time.date | regex_replace('-') }}"
memory: 512MB
memory_swap: 1GB
name: telegraf
restart_policy: always
restart_retries: 3
state: started
volumes:
- /var/etc/docker/telegraf/config/:/etc/telegraf/:ro
from influxdata-docker.
Hi,
Going through older issues.
As stated above, a user will need to install the software they need and the example Dockerfile above is a great start for anyone coming along to figure this out.
Closing this one out. Thanks!
from influxdata-docker.
Related Issues (20)
- Telegraf container - logtarget/logfile not working when using input.docker with special user/group ID HOT 5
- [InfluxDBv2] Wrong Error Description for DOCKER_INFLUXDB_INIT_ADMIN_TOKEN
- [InfluxDBv2] Admin Token via `DOCKER_INFLUXDB_INIT_ADMIN_TOKEN_FILE` env var is not set in the container causing authorization errors HOT 1
- Automated Setup leaves a file behind preventing startup in influxdb:latest HOT 1
- Default directories
- Start Telegraf container with latest config from Influx Web UI [workaround] HOT 3
- Critical CVE-2018-12976 found in latest docker image HOT 6
- Influx DB 1.8 program will not open
- Chronograf 1.10.2 docker image critical vulnerability CVE-2023-45853
- Running in rootless docker is nonfunctional with host filesystem bind mounts due to overriden user ID inside container
- Telegraf: inputs.docker can no longer access Docker socket due to recent entrypoint.sh changes HOT 16
- InfluxDB won't load data after restart - Azure Blob storage
- Telegraf docker entrypoint script change needed to support deployment from compose script HOT 2
- InfluxDB hitting default port even after override with INFLUXD_HTTP_BIND_ADDRESS
- Starting a v2 container throws property not found: `tls-cert`, `tls-key` HOT 3
- influxdb:1.8.10 when deploy it on kubernetes don't create admin user
- Update all influx alpine images to 3.19 HOT 1
- Chronograf: error when upgrading from v1.10.3 to v1.10.4 HOT 3
- influxb image: platform in image-index and image-config do not match HOT 7
- kapacitor: missing documentation for backwards incompatible change to running kapacitor as non-root in v1.7.4 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from influxdata-docker.