Builds Docker images of the Docker Finder architecture (scanner, crawler)
738
The analysis of each image consists in retrieving all the metadata already available in the registry, and in running a container to au- tomatically extract its runtime features (e.g., the software distributions it support). All collected information are used to build the multi-attribute description of an image.
Analysis
|
|___DockerFile_scanner: defines the scanner image.
|___DockerFile_crawler: defines the crawler image.
|___DockerFile_checker: defindes the cheker image.
|
|____pyFinder:
|
|____pyfinder: the python module that defined the code of the scanner, crawler, checker
| |____core:
| |
|
| |____model:
| | |___image.py: the definition of the field |of an image in Docker Finder
| |____resources:
| | |___logging.info: confiuration file for the logging
| |____tests
| |____checker.py: python class of the checker
| |____scanner.py: python class of the scanner
| |____crawler.py: python class of the crawler
| |____ ... (all the other classes)
|
|
|____entryChecker.py: the entrypoint of the checker
|____entryCrawler.py: the entrypoint of the Crawler
|____entryScanner.py: the entrypoint of the Scanner.
Crawler crawls the images'name from a Docker registry. The are two possibilities:
random sampling: Streaming model & know sequence length
s = 0
for (j=1 ; j <= n; j++)
p = Rand(0,1)
if (p <= (m-s)/ n-j+1):
select S[j];
s++
busyking/countryyear:1.0.0 superrogue/mediumdefine:1.0.0 palfool/cordeffect:1.0.0
GET repository info
GET https://hub.docker.com/v2/search/repositories/?query=busyking/countryyear&page_size=100&page=1
{
"count":1,
"next":"",
"previous":"",
"results":[
{
"repo_name":"busyking/countryyear",
"short_description":"",
"star_count":6,
"pull_count":5,
"repo_owner":"",
"is_automated":false,
"is_official":false
}
]
}
Get tags of a REPOSITORY
GET https://hub.docker.com/v2/repositories/busyking/countryyear/tags/
{
"count":1,
"next":null,
"previous":null,
"results":[
{
"name":"1.0.0",
"full_size":176243348,
"images":[
{
"size":176243348,
"architecture":"amd64",
"variant":null,
"features":null,
"os":"linux",
"os_version":null,
"os_features":null
}
],
"id":26338569,
"repository":5434651,
"creator":3053991,
"last_updater":3053991,
"last_updated":"2018-04-26T12:20:13.436111Z",
"image_id":null,
"v2":true
}
]
}
Get a single tag information:
GET https://hub.docker.com/v2/repositories/busyking/countryyear/tags/1.0.0/
{
"name":"1.0.0",
"full_size":176243348,
"images":[
{
"size":176243348,
"architecture":"amd64",
"variant":null,
"features":null,
"os":"linux",
"os_version":null,
"os_features":null
}
],
"id":26338569,
"repository":5434651,
"creator":3053991,
"last_updater":3053991,
"last_updated":"2018-04-26T12:20:13.436111Z",
"image_id":null,
"v2":true
}
Retrieve id of the image
GET http://neri.di.unipi.it:3000/api/images?name=busyking/countryyear:1.0.0&select=id
{
"count":1,
"images":[
{
"_id":"5aeb01706655650011dac605"
}
]
}
Update image description into ImagesServer
PUT http://neri.di.unipi.it:3000/api/images/5aeb01706655650011dac605
{
"repo_name":"busyking/countryyear",
"tag":"1.0.0",
"description":"",
"stars":6,
"pulls":5,
"repo_owner":"",
"is_automated":false,
"is_official":false,
"size": 176243348,
"architecture":"amd64",
"repository":5434651,
"creator":3053991,
"last_updater":3053991,
"last_updated":"2018-04-26T12:20:13.436111Z",
"image_id":null,
"v2":true
}
In order to scan a single image (x = repository:tag) submit the following command in the production server.
docker run --network=dockerfinder_default -v /var/run/docker.sock:/var/run/docker.sock diunipisocc/docker-finder:scanner scan x
Che checker provides consistency among the local description on the images and the remote images (within the Docker Hub). In particular it does the following procedure:
Content type
Image
Digest
Size
42.4 MB
Last updated
about 8 years ago
docker pull dido/dockerfinder:crawler