Skip to content

Instantly share code, notes, and snippets.

@mohsen0
Created June 9, 2018 15:58
Show Gist options
  • Save mohsen0/28b6c4dd7da0f51d826ab36b2acf7976 to your computer and use it in GitHub Desktop.
Save mohsen0/28b6c4dd7da0f51d826ab36b2acf7976 to your computer and use it in GitHub Desktop.
Removing an image from docker registry (Distribution)
#!/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