batchDeleteImage
Deletes a list of specified images within a repository. Images are specified with either an imageTag
or imageDigest
.
You can remove a tag from an image by specifying the image's tag in your request. When you remove the last tag from an image, the image is deleted from your repository.
You can completely delete an image (and all of its tags) by specifying the image's digest in your request.
Samples
import aws.sdk.kotlin.services.ecr.model.ImageIdentifier
fun main() {
//sampleStart
// This example deletes images with the tags precise and trusty in a repository called ubuntu in the
// default registry for an account.
val resp = ecrClient.batchDeleteImage {
repositoryName = "ubuntu"
imageIds = listOf<ImageIdentifier>(
ImageIdentifier {
imageTag = "precise"
}
)
}
//sampleEnd
}