Browse Source

Pass --force when deleting images

We need --force to do proper cleanup. If you end up in a situation
where an image has multiple tags then you won't be able to remove it
without --force.
davidfowl/dependencies
Ryan Nowak 7 years ago
parent
commit
760c47821f
  1. 6
      test/E2ETest/DockerAssert.cs

6
test/E2ETest/DockerAssert.cs

@ -55,15 +55,15 @@ namespace E2ETest
foreach (var id in ids) foreach (var id in ids)
{ {
output.WriteLine($"> docker rmi \"{id}\""); output.WriteLine($"> docker rmi \"{id}\" --force");
var exitCode = await Process.ExecuteAsync( var exitCode = await Process.ExecuteAsync(
"docker", "docker",
$"rmi \"{id}\"", $"rmi \"{id}\" --force",
stdOut: OnOutput, stdOut: OnOutput,
stdErr: OnOutput); stdErr: OnOutput);
if (exitCode != 0) if (exitCode != 0)
{ {
throw new XunitException($"Running `docker rmi \"{id}\"` failed." + Environment.NewLine + builder.ToString()); throw new XunitException($"Running `docker rmi \"{id}\" --force` failed." + Environment.NewLine + builder.ToString());
} }
builder.Clear(); builder.Clear();

Loading…
Cancel
Save