Are you talking about your local machine or you docker registry?
If you are asking about your local machine, you can use docker system prune -a . It will remove everything that is not usedb by your running containers.
docker system prune -a
Our registry, I will specify it in the post for other readers also.
Nice! I have the same problem in the past, but when I was using Amazon ECR.
So for solving this problem I made a script and installed it on a crontab.
#!/bin/bash REPOS=$(aws ecr describe-repositories --region sa-east-1 --query ‘repositories[].repositoryName’ --output text) for repo in $REPOS; do TAGS=$(aws ecr list-images --region sa-east-1 --repository-name $repo --filter tagStatus=UNTAGGED --query ‘imageIds[].imageDigest’ --output text) for tag in $TAGS; do echo “Deleting image: $tag” aws ecr batch-delete-image --region sa-east-1 --repository-name $repo --image-ids imageDigest=$tag done done
This solution is for ECR, but you can build a similar solution for your server.
Nice, If we don't find an official way we will definitely be using this or inspiring from it, thanks for sharing :)
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Are you talking about your local machine or you docker registry?
If you are asking about your local machine, you can use
docker system prune -a
.It will remove everything that is not usedb by your running containers.
Our registry, I will specify it in the post for other readers also.
Nice!
I have the same problem in the past, but when I was using Amazon ECR.
So for solving this problem I made a script and installed it on a crontab.
This solution is for ECR, but you can build a similar solution for your server.
Nice, If we don't find an official way we will definitely be using this or inspiring from it, thanks for sharing :)