use of io.fabric8.docker.api.model.ImageDelete in project ballerina by ballerina-lang.
the class TestUtils method deleteDockerImage.
public static void deleteDockerImage(String imageName) {
if (!imageName.contains(":")) {
imageName += ":" + Constants.IMAGE_VERSION_LATEST;
}
DockerClient client = new io.fabric8.docker.client.DefaultDockerClient();
List<ImageDelete> imageDeleteList = client.image().withName(imageName).delete().force().andPrune(false);
for (ImageDelete imageDelete : imageDeleteList) {
imageDelete.getDeleted();
imageDelete.getUntagged();
}
}
Aggregations