So I have written a script that supposedly removes image by specified tag. From response, it seems like it did remove it. But its unclear if everything related with it was removed.
I used this code to remove it:
conn.request(
'DELETE',
f'/v2/{NAME}/manifests/{TAG}',
headers={
'Accept': 'application/vnd.docker.distribution.manifest.v2+json',
'Authorization': f'Bearer {jwt_token}',
},
)
If I run it again, I get:
b'{"errors":[{"code":"MANIFEST_UNKNOWN","message":"manifest unknown","detail":"s3aws: Path not found: /docker/registry/v2/repositories/myimage/_manifests/tags/feature_docker-hooks-ala"}]}\n'
And I try docker pull myimage:mytag # mytag is tag I deleted
, I get
Error response from daemon: manifest for focusate/base-toc:feature_docker-hooks-ala not found: manifest unknown: manifest unknown
So it looks like it was removed.
But if I go to my hub.docker.com
,
I still see it like it was not deleted:
I thought maybe it was cached, but even using browser in incognito mode, it still show up. So I wonder, did I remove image by tag correctly or I left up some things, so data is still showed on registry.
Its kind of clunky if such information is kept forever as I want it to be automatically cleaned up (to only keep relevant images). Maybe there is some garbage collection that is done periodically and I just need to wait?