fooga
fooga

Reputation: 3

How to delete Docker Image on Azure Container Registry in Java?

I'm looking for a way to delete Docker Image on Azure Container Registry in Java. I want to delete only the Docker Image. I don't want to delete the container registry.

I'm checking the operation according to this Azure sample project, but I don't know how to do it. https://github.com/Azure-Samples/acr-java-manage-azure-container-registry

I read the official document and googled it, but I couldn't find a way to do it, so I asked a question. If you know how to do it, please let me know.

Upvotes: 0

Views: 155

Answers (1)

Vinod Jayachandran
Vinod Jayachandran

Reputation: 3898

Please refer the documentation which guides you how to delete images in a repository

https://learn.microsoft.com/en-us/azure/container-registry/container-registry-delete#delete-by-tag

To delete an image from java, try the below command

dockerClient.removeImageCmd("beaccc8687ae").exec();

Reference - https://www.baeldung.com/docker-java-api#7-remove-an-image

Upvotes: 1

Related Questions