Simpler approach for deleting test repository
Some checks are pending
Some checks are pending
This commit is contained in:
parent
f721101722
commit
325095474a
1 changed files with 3 additions and 11 deletions
|
@ -609,17 +609,9 @@ docker pull localhost:5000/test:latest
|
||||||
# Remove from local Docker
|
# Remove from local Docker
|
||||||
docker rmi localhost:5000/test:latest
|
docker rmi localhost:5000/test:latest
|
||||||
|
|
||||||
# Delete test image from registry using registry API
|
# Delete test repository from registry (simpler approach)
|
||||||
# Get the digest of the latest tag
|
echo "Deleting test repository from registry..."
|
||||||
DIGEST=$(curl -s -H "Accept: application/vnd.docker.distribution.manifest.v2+json" http://localhost:5000/v2/test/manifests/latest | grep -o '"digest":"[^"]*"' | cut -d'"' -f4)
|
curl -X DELETE http://localhost:5000/v2/test/repository
|
||||||
|
|
||||||
# Delete the manifest from registry
|
|
||||||
if [ ! -z "$DIGEST" ]; then
|
|
||||||
echo "Deleting test image from registry..."
|
|
||||||
curl -X DELETE http://localhost:5000/v2/test/manifests/$DIGEST
|
|
||||||
else
|
|
||||||
echo "Could not find digest for test image"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Clean up test file
|
# Clean up test file
|
||||||
rm /tmp/test.Dockerfile
|
rm /tmp/test.Dockerfile
|
||||||
|
|
Loading…
Add table
Reference in a new issue