burnettk / delete-docker-registry-image

If you are running a private v2 docker registry, and you are storing your data on disk, running this script from the machine where the data lives will let you fully delete an image or tag

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ValueError

zhaogj1987 opened this issue · comments

[root@188 script]# ./clean_old_versions.py -i '^itlsatest/essql_' -l 2
Traceback (most recent call last):
File "./clean_old_versions.py", line 90, in
main()
File "./clean_old_versions.py", line 57, in main
repositories = response.json()["repositories"]
File "/usr/lib/python2.7/site-packages/requests/models.py", line 802, in json
return json.loads(self.text, *_kwargs)
File "/usr/lib64/python2.7/json/init.py", line 338, in loads
return _default_decoder.decode(s)
File "/usr/lib64/python2.7/json/decoder.py", line 365, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/lib64/python2.7/json/decoder.py", line 383, in raw_decode
raise ValueError("No JSON object could be decoded")
ValueError: No JSON object could be decoded

it seems likely that it's failing to read images from your docker registry. where is that thing running? you can add a flag like this and set it to the appropriate value: --registry-url http://localhost:5000. this was missing from the README. i've added it. let me know if this doesn't resolve it and you can't figure it out.