Crawler retrieves image RepoTag of container in dockerutils.py, but crawler only keeps the first entry in RepoTags. While crawling an image on private repository, the image might have two or more RepoTags within its metadata. It occurs when multiple images on the host refer to the same image id. In this situation, the second RepoTag might include required information for image crawling. In order to process this case, crawler should append not only the first entry of RepoTags, but also the remaining entries.
How to Reproduce
When we tag an image and push it to private repository, two repotags are assigned to both images.
root@host:~# docker tag mydebian:test mycluster.icp:8500/default/mydebian:test
root@host:~# docker push mycluster.icp:8500/default/mydebian:test
root@host:~# docker images | head
REPOSITORY TAG IMAGE ID CREATED SIZE
mycluster.icp:8500/mydebian test 65db38df9855 10 hours ago 100MB
mydebian test 65db38df9855 10 hours ago 100MB
root@host:~# docker image inspect mycluster.icp:8500/mydebian:test
[
{
"Id": "sha256:65db38df9855e0ef5df019e6dba6f3df68a32293a030244de2d2eda80c465658",
"RepoTags": [
"mydebian:test",
"mycluster.icp:8500/default/mydebian:test"
],
...
For reg crawler, the second repotag is required for making namespace.
Description
Crawler retrieves image RepoTag of container in
dockerutils.py
, but crawler only keeps the first entry in RepoTags. While crawling an image on private repository, the image might have two or more RepoTags within its metadata. It occurs when multiple images on the host refer to the same image id. In this situation, the second RepoTag might include required information for image crawling. In order to process this case, crawler should append not only the first entry of RepoTags, but also the remaining entries.How to Reproduce
When we tag an image and push it to private repository, two repotags are assigned to both images.
For reg crawler, the second repotag is required for making namespace.
Log Output
Debugging Commands Output
Output of
docker version
:Output of
docker info
:Output of
python --version
:Output of
pip freeze
: