Clean up the test repository from the registry at the end of the test step
Some checks are pending
Some checks are pending
This commit is contained in:
parent
bb940ce6f0
commit
f721101722
1 changed files with 20 additions and 1 deletions
|
@ -605,10 +605,29 @@ curl http://localhost:5000/v2/test/tags/list
|
|||
docker rmi localhost:5000/test:latest
|
||||
docker pull localhost:5000/test:latest
|
||||
|
||||
# Clean up test image
|
||||
# Clean up test image completely
|
||||
# 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
|
||||
|
||||
# Clean up test file
|
||||
rm /tmp/test.Dockerfile
|
||||
|
||||
# Verify registry is empty
|
||||
echo "Registry contents after cleanup:"
|
||||
curl http://localhost:5000/v2/_catalog
|
||||
|
||||
# Exit SERVICE_USER shell
|
||||
exit
|
||||
```
|
||||
|
|
Loading…
Add table
Reference in a new issue