Docker Image Comparison Database Manager
Project description
docker-diff
Docker Image Comparison Database Manager. Scans Docker images, stores file listings and comparisons in SQLite, and provides a simple CLI to query results.
Quick Start
- Install dependencies and project env (uv):
uv sync
- Run the CLI:
- Local:
uv run docker_diff_pkg/cli.py list images - After install:
docker-diff list images
- Local:
Database Backends
This project supports two SQLite-compatible backends:
- Local SQLite file via Python
sqlite3(default) atdocker_images.db. - Remote Turso via
libsqlPython client.
The database schema initializes automatically on first run from docker_diff_pkg/schema.sql.
Using Turso (libsql)
- Ensure dependency is installed
- The project declares
libsql-clientinpyproject.toml. If you updated sources, runuv sync.
- Set environment variables
- URL:
TURSO_DATABASE_URL(preferred) orLIBSQL_URL - Token:
TURSO_AUTH_TOKENorLIBSQL_AUTH_TOKEN
Examples (macOS/Linux):
- Prefer HTTPS (avoids WebSocket restrictions):
export TURSO_DATABASE_URL="https://<your-db>.turso.io"export TURSO_AUTH_TOKEN="<your-token>"
- WebSocket (Hrana) alternative:
export TURSO_DATABASE_URL="libsql://<your-db>.turso.io"export TURSO_AUTH_TOKEN="<your-token>"
- Run a command
uv run docker_diff_pkg/cli.py list images- or:
python -m docker_diff_pkg.cli list images
Troubleshooting
-
WebSocket handshake errors (e.g.,
WsServerHandshakeError):- Cause:
libsql://uses WebSockets (Hrana). Corporate proxies/firewalls often blockwss. - Fix: Switch to HTTPS: set
TURSO_DATABASE_URL="https://<db>.turso.io"and keep the same token. - Optional: adjust proxies: unset
HTTP(S)_PROXY, or setNO_PROXY="*.turso.io,localhost,127.0.0.1".
- Cause:
-
Command hangs and does not exit:
- The libsql client runs a background event loop thread. The CLI now closes the client on exit. If embedding
DockerImageDBin your own code, calldb.close()when done.
- The libsql client runs a background event loop thread. The CLI now closes the client on exit. If embedding
-
Auth failures (401/403):
- Ensure the token belongs to the target DB and hasn’t expired.
CLI Overview
- Scan images:
docker-diff scan <image...> - Compare images:
docker-diff compare <image...> [--name NAME] - List images:
docker-diff list images - List comparisons:
docker-diff list comparisons - Summary:
docker-diff summary <id> - Unique files:
docker-diff unique <id> [--limit N]
Development
- Build:
make build - Clean:
make clean - Integration Test:
make integration-test - Add dev dep:
uv add --group dev <package>
Notes
- Python 3.10+ with type hints.
- SQLite with proper FKs and indexes; schema in
docker_diff_pkg/schema.sql. - DB access is abstracted to support both backends without changing CLI usage.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file docker_diff-0.0.8-py3-none-any.whl.
File metadata
- Download URL: docker_diff-0.0.8-py3-none-any.whl
- Upload date:
- Size: 12.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6de4bbbccab0ee13ab778bbc7a830b67674bfda796fe045fcf38382fa207b706
|
|
| MD5 |
0db702968836098c8c1b1984477cd073
|
|
| BLAKE2b-256 |
43e520eb2af01376d34862078438d9bdcb40bba3cbf40608608a3b7d225613c3
|
Provenance
The following attestation bundles were made for docker_diff-0.0.8-py3-none-any.whl:
Publisher:
publish.yml on eapolinario/docker-diff
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
docker_diff-0.0.8-py3-none-any.whl -
Subject digest:
6de4bbbccab0ee13ab778bbc7a830b67674bfda796fe045fcf38382fa207b706 - Sigstore transparency entry: 496750954
- Sigstore integration time:
-
Permalink:
eapolinario/docker-diff@1f220aea3e8d7dd67a9979ddaafcc566bbdbf2fd -
Branch / Tag:
refs/tags/v0.0.8 - Owner: https://github.com/eapolinario
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@1f220aea3e8d7dd67a9979ddaafcc566bbdbf2fd -
Trigger Event:
release
-
Statement type: