admin管理员组文章数量:1024614
In order to avoid having builds that run for a long time only to fail at the end with docker push because some issue with docker not running (properly), I want builds to fail immediately then and have added a task "FailFastIfDockerIsNotWorking" as the very first task, and it just calls DockerImageLs
as a smoke test to see that docker is working.
However recently there was a build that hang on that task until the whole build timed out because of some issue with docker not running properly.
So I would like to add a timeout to DockerImageLs to avoid that happening again. My attempt was the following:
Task("FailFastIfDockerIsNotWorking")
.Does<Config>((config) =>
{
// .Docker/DockerAliases/832AACA7
// .Docker/DockerImageLsSettings/
var settings = new DockerImageLsSettings();
// .Core.Tooling/ToolSettingsExtensions/102470BF
settings.WithToolTimeout(TimeSpan.FromSeconds(30));
var images = DockerImageLs(settings);
Information($"{images.Count()} images present");
});
however when running it fails with
========================================
FailFastIfDockerIsNotWorking
========================================
unknown flag: --tool-timeout
See 'docker image ls --help'.
An error occurred when executing task 'FailFastIfDockerIsNotWorking'.
Error: Docker: Process returned an error (exit code 125).
Looking at the implementation of the ToolTimeout setting I expected WithToolTimeout
to work and was surprised to discover that it somehow was translated to a command line option instead.
So how do I enforce a timeout when calling DockerImageLs
?
In order to avoid having builds that run for a long time only to fail at the end with docker push because some issue with docker not running (properly), I want builds to fail immediately then and have added a task "FailFastIfDockerIsNotWorking" as the very first task, and it just calls DockerImageLs
as a smoke test to see that docker is working.
However recently there was a build that hang on that task until the whole build timed out because of some issue with docker not running properly.
So I would like to add a timeout to DockerImageLs to avoid that happening again. My attempt was the following:
Task("FailFastIfDockerIsNotWorking")
.Does<Config>((config) =>
{
// .Docker/DockerAliases/832AACA7
// .Docker/DockerImageLsSettings/
var settings = new DockerImageLsSettings();
// .Core.Tooling/ToolSettingsExtensions/102470BF
settings.WithToolTimeout(TimeSpan.FromSeconds(30));
var images = DockerImageLs(settings);
Information($"{images.Count()} images present");
});
however when running it fails with
========================================
FailFastIfDockerIsNotWorking
========================================
unknown flag: --tool-timeout
See 'docker image ls --help'.
An error occurred when executing task 'FailFastIfDockerIsNotWorking'.
Error: Docker: Process returned an error (exit code 125).
Looking at the implementation of the ToolTimeout setting I expected WithToolTimeout
to work and was surprised to discover that it somehow was translated to a command line option instead.
So how do I enforce a timeout when calling DockerImageLs
?
本文标签: cakebuildHow to enforce a timeout for calling DockerImageLs in CakeStack Overflow
版权声明:本文标题:cakebuild - How to enforce a timeout for calling DockerImageLs in Cake? - Stack Overflow 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://it.en369.cn/questions/1745622232a2159644.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论