Created
June 9, 2018 15:58
-
-
Save mohsen0/28b6c4dd7da0f51d826ab36b2acf7976 to your computer and use it in GitHub Desktop.
Removing an image from docker registry (Distribution)
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
#!/bin/bash -ex | |
registry=${1} | |
name=${2} | |
tag=${3} | |
curl -v -sSL -X DELETE "https://${registry}/v2/${name}/manifests/$( | |
curl -sSL -I \ | |
-H "Accept: application/vnd.docker.distribution.manifest.v2+json" \ | |
"http://${registry}/v2/${name}/manifests/${tag}" \ | |
| awk '$1 == "Docker-Content-Digest:" { print $2 }' \ | |
| tr -d $'\r' \ | |
)" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment