Created
December 13, 2025 12:22
-
-
Save gchait/7505e8d6ecefb4852ab33d38f1c29a5e to your computer and use it in GitHub Desktop.
Keep only a specific tag from a Docker repository
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # shellcheck disable=SC2086 | |
| docker images -q "${DOCKER_REPO_FULL}" | \ | |
| grep -v "$(docker images -q ${DOCKER_IMAGE})" | \ | |
| xargs --no-run-if-empty docker rmi -f |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
For latest: