-
Notifications
You must be signed in to change notification settings - Fork 3
Home
The Container Analysis project gathers information about Docker containers from public repositories. Starting with a Helm index chart file, this Python project will crawl, curate, and output helpful information about Applications which are composed of different containers.
Since IBM Cloud Private's (ICP) inception, Applications have been created which are made up of 1 or many containers and there has been a strong need to know which hardware (architectures) a container can run on. It is important to know where a container is hosted, which versions of the containers are available, and what architectures the container can run on.
Each Application contains Images and each Image contains Tags called containers.
Application's are objects called an App stored in objects/image.py.
Images are objects referred to as image_obj, since each Image is associated with an Application. An Application typically has many Images.
To crawl dockerhub, a Hub object is created to handle the authentication tokens and packet headers in order to authenticate against hub.docker.com. See objects/hub.py for more information.
Execution of get-image-info.py
Once executing python3 get-image-info.py user.yaml
, the following will happen:
- Helm index chart is downloaded, unless
--index
is given - Get hub list and creds from user.yaml
- Initialize Application object with (name, base_url, keywords) from index.yaml
- Setup file output
- Get Product name for App from first line of App's README.md
- Get the keywords for the App. If
---debug
is given, download Chart.yaml - Download values.yaml and save in Applications/{app_name}/values.yaml
- Parse repos, images, tags from values.yaml. Image object is initialized.
- Crawl dockerhub
- Output to csv in archives/ with date.
If debug mode is specified, a file called generated_input.yaml will be created. This file contains details about each Application and it's respective Images. In addition to this file, Chart.yaml will also be downloaded and saved to the Applications/ for each app. If debug mode is not specified, keywords are taken from the index.yaml and Chart.yaml is not downloaded at all.
The fastest way to run the program is by executing:
python3 get-image-info.py user.yaml -k -i index.yaml
however, this script will use information that has been previously downloaded (kept) and will not provide accurate information.
Please read the Contributing guide