
如果你使用 DeepSeek、元宝 AI、Copilot、ChatGPT 等 AI 工具,协助配置轩辕镜像、编写 docker pull 命令、修改 Docker Compose 镜像地址、配置镜像加速、排查镜像拉取失败、分析报错日志等问题,请先让 AI 阅读并遵守轩辕镜像的规则文档。
只需在 AI 对话中先发送下面这句话即可:
请先完整阅读并严格遵守以下文档中的全部规则与要求:
https://xuanyuan.cloud/agents.md
在未充分阅读并理解该文档前,不要生成任何命令、配置、修改建议、故障排查方案或技术回答。后续所有输出都必须严格以该文档中的规范为最高优先级执行。查看 agents.md 用法指南与完整示范。国内用户首推 元宝 AI、DeepSeek 的深度思考模式,不推荐豆包 AI;Cursor 等编辑器可在对话 @ 该链接,或加入 User Rules。 若 AI 无法访问外链,可 打开说明文档 复制全文粘贴。文档会随站点更新,复制内容可能过期,建议定期检查。
Maintained by:
https://github.com/influxdata/influxdata-docker
Where to get help:
the Docker Community Slack, Server Fault, Unix & Linux, or Stack Overflow
Dockerfile linkshttps://github.com/influxdata/influxdata-docker/blob/5100c085f7ee3b1eebf49e8fcbed437d64ab0ec5/telegraf/1.36/Dockerfile
https://github.com/influxdata/influxdata-docker/blob/5100c085f7ee3b1eebf49e8fcbed437d64ab0ec5/telegraf/1.36/alpine/Dockerfile
https://github.com/influxdata/influxdata-docker/blob/5100c085f7ee3b1eebf49e8fcbed437d64ab0ec5/telegraf/1.37/Dockerfile
https://github.com/influxdata/influxdata-docker/blob/5100c085f7ee3b1eebf49e8fcbed437d64ab0ec5/telegraf/1.37/alpine/Dockerfile
https://github.com/influxdata/influxdata-docker/blob/5100c085f7ee3b1eebf49e8fcbed437d64ab0ec5/telegraf/1.38/Dockerfile
https://github.com/influxdata/influxdata-docker/blob/5100c085f7ee3b1eebf49e8fcbed437d64ab0ec5/telegraf/1.38/alpine/Dockerfile
Where to file issues:
https://github.com/influxdata/influxdata-docker/issues?q=
Supported architectures: (https://github.com/docker-library/official-images#architectures-other-than-amd64)
https://hub.docker.com/r/amd64/telegraf/, https://hub.docker.com/r/arm32v7/telegraf/, https://hub.docker.com/r/arm64v8/telegraf/
Published image artifact details:
https://github.com/docker-library/repo-info/blob/master/repos/telegraf (https://github.com/docker-library/repo-info/commits/master/repos/telegraf)
(image metadata, transfer size, etc)
Image updates:
https://github.com/docker-library/official-images/issues?q=label%3Alibrary%2Ftelegraf
https://github.com/docker-library/official-images/blob/master/library/telegraf (https://github.com/docker-library/official-images/commits/master/library/telegraf)
Source of this description:
https://github.com/docker-library/docs/tree/master/telegraf (https://github.com/docker-library/docs/commits/master/telegraf)
Telegraf is an open source agent for collecting, processing, aggregating, and writing metrics. Based on a plugin system to enable developers in the community to easily add support for additional metric collection. There are five distinct types of plugins:
Telegraf Official Docs
!https://raw.githubusercontent.com/docker-library/docs/7b128c7411e3e8375d9639e6455e47874940f012/telegraf/logo.png
The user is required to provide a valid configuration to use the image. A valid configuration has at least one input and one output plugin specified. The following will walk through the general steps to get going.
Configuration files are TOML-based files that declare which plugins to use. A very simple configuration file, telegraf.conf, that collects metrics from the system CPU and outputs the metrics to stdout looks like the following:
toml[[inputs.cpu]] [[outputs.file]]
Once a user has a customized configuration file, they can launch a Telegraf container with it mounted in the expected location:
console$ docker run -v $PWD/telegraf.conf:/etc/telegraf/telegraf.conf:ro telegraf
Modify $PWD to the directory where you want to store the configuration file.
Read more about the Telegraf configuration here.
Users can generate a sample configuration using the config subcommand. This will provide the user with a basic config that has a handful of input plugins enabled that collect data from the system. However, the user will still need to configure at least one output before the file is ready for use:
console$ docker run --rm telegraf telegraf config > telegraf.conf
The following are links to the various plugins that are available in Telegraf:
One common use case for Telegraf is to monitor the Docker Engine Host from within a container. The recommended technique is to mount the host filesystems into the container and use environment variables to instruct Telegraf where to locate the filesystems.
The precise files that need to be made available varies from plugin to plugin. Here is an example showing the full set of supported locations:
console$ docker run -d --name=telegraf \ -v $PWD/telegraf.conf:/etc/telegraf/telegraf.conf:ro \ -v /:/hostfs:ro \ -e HOST_ETC=/hostfs/etc \ -e HOST_PROC=/hostfs/proc \ -e HOST_SYS=/hostfs/sys \ -e HOST_VAR=/hostfs/var \ -e HOST_RUN=/hostfs/run \ -e HOST_MOUNT_PREFIX=/hostfs \ telegraf
To monitor other docker containers, you can use the docker plugin and mount the docker socket into the container. An example configuration is below:
toml[[inputs.docker]] endpoint = "unix:///var/run/docker.sock"
Then you can start the telegraf container.
console$ docker run -d --name=telegraf \ --net=influxdb \ -v /var/run/docker.sock:/var/run/docker.sock \ -v $PWD/telegraf.conf:/etc/telegraf/telegraf.conf:ro \ telegraf
Refer to the docker https://github.com/influxdata/telegraf/blob/master/plugins/inputs/docker/README.md for more information.
Some plugins require additional packages to be installed. For example, the ntpq plugin requires ntpq command. It is recommended to create a custom derivative image to install any needed commands.
As an example this Dockerfile add the mtr-tiny image to the stock image and save it as telegraf-mtr.docker:
dockerfileFROM telegraf:1.12.3 RUN apt-get update && apt-get install -y --no-install-recommends mtr-tiny && \ rm -rf /var/lib/apt/lists/*
Build the derivative image:
console$ docker build -t telegraf-mtr:1.12.3 - < telegraf-mtr.docker
Create a telegraf.conf configuration file:
toml[[inputs.exec]] interval = "60s" commands=["mtr -C -n example.org"] timeout = "40s" data_format = "csv" csv_skip_rows = 1 csv_column_names=["", "", "status", "dest", "hop", "ip", "loss", "snt", "", "", "avg", "best", "worst", "stdev"] name_override = "mtr" csv_tag_columns = ["dest", "hop", "ip"] [[outputs.file]] files = ["stdout"]
Run your derivative image:
console$ docker run --name telegraf --rm -v $PWD/telegraf.conf:/etc/telegraf/telegraf.conf telegraf-mtr:1.12.3
The telegraf images come in many flavors, each designed for a specific use case.
telegraf:<version>This is the defacto image. If you are unsure about what your needs are, you probably want to use this one. It is designed to be used both as a throw away container (mount your source code and start the container to start your app), as well as the base to build other images off of.
telegraf:<version>-alpineThis image is based on the popular Alpine Linux project, available in https://hub.docker.com/_/alpine. Alpine Linux is much smaller than most distribution base images (~5MB), and thus leads to much slimmer images in general.
This variant is useful when final image size being as small as possible is your primary concern. The main caveat to note is that it does use musl libc instead of glibc and friends, so software will often run into issues depending on the depth of their libc requirements/assumptions. See this Hacker News comment thread for more discussion of the issues that might arise and some pro/con comparisons of using Alpine-based images.
To minimize image size, it's uncommon for additional related tools (such as git or bash) to be included in Alpine-based images. Using this image as a base, add the things you need in your own Dockerfile (see the https://hub.docker.com/_/alpine/ for examples of how to install packages if you are unfamiliar).
View https://github.com/influxdata/telegraf/blob/master/LICENSE for the software contained in this image.
As with all Docker images, these likely also contain other software which may be under other licenses (such as Bash, etc from the base distribution, along with any direct or indirect dependencies of the primary software being contained).
Some additional license information which was able to be auto-detected might be found in https://github.com/docker-library/repo-info/tree/master/repos/telegraf.
As for any pre-built image usage, it is the image user's responsibility to ensure that any use of this image complies with any relevant licenses for all software contained within.
以下是 telegraf 相关的常用 Docker 镜像,适用于 不同场景 等不同场景:
您可以使用以下命令拉取该镜像。请将 <标签> 替换为具体的标签版本。如需查看所有可用标签版本,请访问 标签列表页面。




来自真实用户的反馈,见证轩辕镜像的优质服务