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
|
||||
docker rmi localhost:5000/test:latest
|
||||
|
||||
# Delete test image from registry using registry API
|
||||
# Get the digest of the latest tag
|
||||
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)
|
||||
|
||||
# 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
|
||||
# Delete test repository from registry (simpler approach)
|
||||
echo "Deleting test repository from registry..."
|
||||
curl -X DELETE http://localhost:5000/v2/test/repository
|
||||
|
||||
# Clean up test file
|
||||
rm /tmp/test.Dockerfile
|
||||
|
|
Loading…
Add table
Reference in a new issue