# jhon287/docker-registry-scanner architecture

> Architecture diagram of the GitHub repository jhon287/docker-registry-scanner, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-08). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/jhon287/docker-registry-scanner
- Repository: https://github.com/jhon287/docker-registry-scanner

## Overview

Docker Registry Scanner enumerates registry images and tags, filters them, then scans each tag with Trivy. It reports status to standard output and writes a JSON results file. `src/main.py` orchestrates the workflow; configuration, registry access, scan options, and scanning are the main internal layers. Trivy and the registry are external dependencies. Relationships shown here are supported by the README or excerpts; unsampled implementation details are omitted.

Main entry points: [`src/main.py`](https://github.com/jhon287/docker-registry-scanner/blob/main/src/main.py) (Scan workflow), [`src/scanner.py`](https://github.com/jhon287/docker-registry-scanner/blob/main/src/scanner.py) (Image scanner), [`src/logger.py`](https://github.com/jhon287/docker-registry-scanner/blob/main/src/logger.py) (Logging), [`src/docker_registry_client.py`](https://github.com/jhon287/docker-registry-scanner/blob/main/src/docker_registry_client.py) (Registry client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_orchestration["Workflow orchestration"]
  node_main["Scan workflow<br/>[main.py]"]
  node_config["Runtime configuration<br/>[config.py]"]
end

subgraph group_registry["Registry access"]
  node_registry_client["Registry client"]
  node_registry_service["Docker registry"]
end

subgraph group_scanning["Image scanning"]
  node_scan_options["Scan options<br/>[scanner_options.py]"]
  node_database_download["Database download<br/>[scanner.py]"]
  node_scanner["Image scanner<br/>[scanner.py]"]
  node_trivy["Trivy scanner"]
end

subgraph group_reporting["Results reporting"]
  node_logger["Logging<br/>[logger.py]"]
  node_stdout["Standard output"]
  node_report_file["JSON report file<br/>[main.py]"]
end

node_operator(("Operator"))

node_operator -.->|"starts scan"| node_main
node_main -->|"reads settings"| node_config
node_main -->|"creates client"| node_registry_client
node_registry_client -->|"requests catalog and tags"| node_registry_service
node_main -->|"builds options"| node_scan_options
node_main -->|"downloads database"| node_database_download
node_database_download -->|"runs database download"| node_trivy
node_main -->|"creates and runs scanner"| node_scanner
node_scanner -->|"runs image scans"| node_trivy
node_scanner -->|"uses options"| node_scan_options
node_main -->|"logs progress"| node_logger
node_main -->|"displays statuses"| node_stdout
node_main -->|"writes JSON report"| node_report_file
node_registry_client -->|"logs redirects"| node_logger
node_scanner -->|"logs scans"| node_logger
node_logger -->|"reads log level"| node_config

click node_main "https://github.com/jhon287/docker-registry-scanner/blob/main/src/main.py"
click node_config "https://github.com/jhon287/docker-registry-scanner/blob/main/src/config.py"
click node_registry_client "https://github.com/jhon287/docker-registry-scanner/blob/main/src/docker_registry_client.py"
click node_scan_options "https://github.com/jhon287/docker-registry-scanner/blob/main/src/scanner_options.py"
click node_database_download "https://github.com/jhon287/docker-registry-scanner/blob/main/src/scanner.py"
click node_scanner "https://github.com/jhon287/docker-registry-scanner/blob/main/src/scanner.py"
click node_logger "https://github.com/jhon287/docker-registry-scanner/blob/main/src/logger.py"
click node_report_file "https://github.com/jhon287/docker-registry-scanner/blob/main/src/main.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_main,node_config toneBlue
class node_registry_client,node_registry_service toneAmber
class node_scan_options,node_database_download,node_scanner,node_trivy toneMint
class node_logger,node_stdout,node_report_file toneRose
class node_operator toneIndigo
```

## Components

### Workflow orchestration

- [Scan workflow](https://github.com/jhon287/docker-registry-scanner/blob/main/src/main.py): `src/main.py`
- [Runtime configuration](https://github.com/jhon287/docker-registry-scanner/blob/main/src/config.py): `src/config.py`

### Registry access

- [Registry client](https://github.com/jhon287/docker-registry-scanner/blob/main/src/docker_registry_client.py): `src/docker_registry_client.py`
- **Docker registry**

### Image scanning

- [Scan options](https://github.com/jhon287/docker-registry-scanner/blob/main/src/scanner_options.py): `src/scanner_options.py`
- [Database download](https://github.com/jhon287/docker-registry-scanner/blob/main/src/scanner.py): `src/scanner.py`
- [Image scanner](https://github.com/jhon287/docker-registry-scanner/blob/main/src/scanner.py): `src/scanner.py`
- **Trivy scanner**

### Results reporting

- [Logging](https://github.com/jhon287/docker-registry-scanner/blob/main/src/logger.py): `src/logger.py`
- **Standard output**
- [JSON report file](https://github.com/jhon287/docker-registry-scanner/blob/main/src/main.py): `src/main.py`

### Other components

- **Operator**

## Connections

- Operator → Scan workflow: starts scan (evidence: `README.md`)
- Scan workflow → Runtime configuration: reads settings (evidence: `src/main.py`)
- Scan workflow → Registry client: creates client (evidence: `src/main.py`)
- Registry client → Docker registry: requests catalog and tags (evidence: `src/docker_registry_client.py`)
- Scan workflow → Scan options: builds options (evidence: `src/main.py`)
- Scan workflow → Database download: downloads database (evidence: `src/main.py`)
- Database download → Trivy scanner: runs database download (evidence: `src/scanner.py`)
- Scan workflow → Image scanner: creates and runs scanner (evidence: `src/main.py`)
- Image scanner → Trivy scanner: runs image scans (evidence: `src/scanner.py`)
- Image scanner → Scan options: uses options (evidence: `src/scanner.py`)
- Scan workflow → Logging: logs progress (evidence: `src/main.py`)
- Scan workflow → Standard output: displays statuses (evidence: `README.md`)
- Scan workflow → JSON report file: writes JSON report (evidence: `src/main.py`)
- Registry client → Logging: logs redirects (evidence: `src/docker_registry_client.py`)
- Image scanner → Logging: logs scans (evidence: `src/scanner.py`)
- Logging → Runtime configuration: reads log level (evidence: `src/logger.py`)
