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
?
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745622233a4636589.html
评论列表(0条)