如何在Docker上运行Thanos?

时间:2019-11-08 06:31:55

标签: docker

我想运行Thanos和Docker。我怎样才能做到这一点?现在,我正在尝试这种方式:

sudo docker run --name thanos -d -p 10902:10902 improbable/thanos:master

但状态为:Exited (0) 10 seconds ago

docker logs thanos的结果是:

usage: thanos [<flags>] <command> [<args> ...]

A block storage based long-term storage for Prometheus

Flags:
  -h, --help            Show context-sensitive help (also try --help-long and
                    --help-man).
  --version         Show application version.
  --log.level=info  Log filtering level.
  --gcloudtrace.project=GCLOUDTRACE.PROJECT
                    GCP project to send Google Cloud Trace tracings to. If
                    empty, tracing will be disabled.
  --gcloudtrace.sample-factor=1
                    How often we send traces (1/<sample-factor>). If 0 no
                    trace will be sent periodically, unless forced by
                    baggage item. See `pkg/tracing/tracing.go` for details.

Commands:
  [Commands...]

未找到错误。怎么了?

1 个答案:

答案 0 :(得分:1)

您需要为thanos提供完整的命令,例如:

sudo docker run --name thanos -d -p 10902:10902 improbable/thanos:master --version

将打印thanos版本并退出容器

解释:

在图像上有一个thanos的Entrypoint命令,它将在启动容器时始终运行,因此,如果不向thanos命令提供任何参数,您将获得帮助消息。该命令和conatiner将以退出代码0正常退出,因为它已经运行了提供的命令