File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -9,14 +9,16 @@ public sealed class DockerUtils
9
9
{
10
10
public static void AttemptDeleteDockerVolume ( string volumeName , bool throwOnFailure = false )
11
11
{
12
+ string containerRuntime = Environment . GetEnvironmentVariable ( "DOTNET_ASPIRE_CONTAINER_RUNTIME" ) ?? "docker" ;
13
+
12
14
for ( var i = 0 ; i < 3 ; i ++ )
13
15
{
14
16
if ( i != 0 )
15
17
{
16
18
Thread . Sleep ( 1000 ) ;
17
19
}
18
20
19
- if ( Process . Start ( "docker" , $ "volume rm { volumeName } ") is { } process )
21
+ if ( Process . Start ( containerRuntime , $ "volume rm { volumeName } ") is { } process )
20
22
{
21
23
var exited = process . WaitForExit ( TimeSpan . FromSeconds ( 3 ) ) ;
22
24
var done = exited && process . ExitCode == 0 ;
@@ -32,7 +34,7 @@ public static void AttemptDeleteDockerVolume(string volumeName, bool throwOnFail
32
34
33
35
if ( throwOnFailure )
34
36
{
35
- if ( Process . Start ( "docker" , $ "volume inspect { volumeName } ") is { } process )
37
+ if ( Process . Start ( containerRuntime , $ "volume inspect { volumeName } ") is { } process )
36
38
{
37
39
var exited = process . WaitForExit ( TimeSpan . FromSeconds ( 3 ) ) ;
38
40
var exitCode = process . ExitCode ;
You can’t perform that action at this time.
0 commit comments