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.
Metadata
Release files for docker-diff 0.0.10
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| docker_diff-0.0.10-py3-none-any.whl | Python 3 | none | any | Details |
Release files / docker_diff-0.0.10-py3-none-any.whl
| Download URL | docker_diff-0.0.10-py3-none-any.whl |
|---|---|
| Size | 14.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d1a3f2ea9a3c1cc27e592f32a3adce204477796907e617627a979c94996d9a29
|
|
BLAKE2b-256 checksum How to use checksums |
85ced78ac2ff21d1671c0b1fee2d79c88f00878cc12231daced97ffc47cb5688
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 11, 2025.
Transparency log