gpt4 book ai didi

docker - 无法挂载 docker volume 来运行 opentelemetry 图像

转载 作者:行者123 更新时间:2023-12-05 05:55:42 54 4
gpt4 key购买 nike

我尝试使用配置 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

应用程序似乎无法读取卷中传递的文件,因为它看起来是一个目录,而不是一个文件。

有没有人知道我如何将这个文件作为文件挂载,或者指导我做错什么?

我已经尝试了文件名周围有/没有 " 的所有可能组合,或者也尝试了 = 到 var 赋值 - 到目前为止没有任何效果。

请注意,我在 Windows 上工作,以防这与操作系统相关。

最佳答案

感谢这个post,我终于找到了答案

您需要指定要挂载的文件的完整路径。如果没有,因为 docker 找不到 fill,它会根据文件名创建一个空目录!

关于docker - 无法挂载 docker volume 来运行 opentelemetry 图像,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/69402774/

54 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com