1

我正在创建一个 docker swarm 服务,如果其中一个容器在服务中停止,它将立即在可用的 swarm 节点之一中安排 docker 容器,我想使用 docker API 将该计划延迟 5 秒。在 API 版本 1.26 文档中,它指定了类似这样的内容

"RestartPolicy": { "Condition": "on-failure", "Delay": 10000000000, "MaxAttempts": 10 } 什么是(迪利:10000000000)。是毫秒还是纳秒?

4

1 回答 1

0

最新的 Docker API 1没有指定,但我们可以假设它指的是纳秒,因为 Healthcheck 持续时间也是纳秒:

**Interval** - The time to wait between checks in nanoseconds. It should be 0 or at least 1000000 (1 ms). 0 means inherit.

**StartPeriod** - The time to wait for container initialization before starting health-retries countdown in nanoseconds. It should be 0 or at least 1000000 (1 ms). 0 means inherit.
于 2017-06-14T23:39:32.877 回答