【发布时间】:2021-11-22 22:02:35
【问题描述】:
我尝试使用配置 yaml 文件作为参数运行 opentelemetry docker 映像:
docker run -v "./otel-collector-config.yaml":/otel-collector-config.yaml -p 4317:4317 otel/opentelemetry-collector:latest --config=otel-collector-config.yaml
我不断收到此错误消息:
2021-10-01T08:21:05.384Z info service/collector.go:303 Starting otelcol... {"Version": "0.35.0", "NumCPU": 12}
2021-10-01T08:21:05.384Z info service/collector.go:242 Loading configuration...
Error: cannot load configuration's parser: error loading config file "/etc/otel-collector-config.yaml": unable to read the file /etc/otel-collector-config.yaml: read /etc/otel-collector-config.yaml: is a directory
2021/10/01 08:21:05 application run finished with error: cannot load configuration's parser: error loading config file "/etc/otel-collector-config.yaml": unable to read the file /etc/otel-collector-config.yaml: read /etc/otel-collector-config.yaml: is a directory
似乎该应用无法读取卷中传递的文件,因为它似乎是一个目录,而不是一个文件。
有没有人知道如何将这个文件作为文件挂载,或者指导我做错了什么?
我已经尝试了所有可能的文件名周围有/没有" 的组合,或者也尝试使用= 来分配变量 - 到目前为止没有任何效果。
请注意我正在处理Windows,以防这会与操作系统相关的问题。
【问题讨论】:
标签: docker volume open-telemetry