厨师 docker_container 使用 health_check
我正在尝试在Chef中使用Health_check Docker功能,但是我遇到以下错误:
had an error: Docker::Error::ClientError: Interval in Healthcheck cannot be less than 1ms
我有以下厨师配置:
docker_container my_contianer do
command container_command
action :run
repo repo
tag tag
user 'app'
restart_policy 'always'
env envs
volumes volumes
port [
"80:8000"
]
memory max_container_memory
if container_config.key?('health_check')
health_check(
'Test' =>
[
'curl localhost:8000/health || exit 1',
],
'Interval' => 30,
'Timeout' => 10,
'Retries' => 10,
'StartPeriod' => 0
)
end
end
我也尝试了“ 30s”,但它不起作用,任何想法我应该如何使用此health_check函数?
I am trying to use the health_check docker feature in chef, but I am getting the following error:
had an error: Docker::Error::ClientError: Interval in Healthcheck cannot be less than 1ms
I have the following chef config:
docker_container my_contianer do
command container_command
action :run
repo repo
tag tag
user 'app'
restart_policy 'always'
env envs
volumes volumes
port [
"80:8000"
]
memory max_container_memory
if container_config.key?('health_check')
health_check(
'Test' =>
[
'curl localhost:8000/health || exit 1',
],
'Interval' => 30,
'Timeout' => 10,
'Retries' => 10,
'StartPeriod' => 0
)
end
end
I also tried '30s' and it did not work, any idea how should I use this health_check function?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
基本上我通过以下方式实现了它:
Basically I managed to achieve it by the following: