Skip to main content

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

Database Backends

This project supports two SQLite-compatible backends:

  • Local SQLite file via Python sqlite3 (default) at docker_images.db.
  • Remote Turso via libsql Python client.

The database schema initializes automatically on first run from docker_diff_pkg/schema.sql.

Using Turso (libsql)

  1. Ensure dependency is installed
  • The project declares libsql-client in pyproject.toml. If you updated sources, run uv sync.
  1. Set environment variables
  • URL: TURSO_DATABASE_URL (preferred) or LIBSQL_URL
  • Token: TURSO_AUTH_TOKEN or LIBSQL_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>"
  1. 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 block wss.
    • 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 set NO_PROXY="*.turso.io,localhost,127.0.0.1".
  • 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 DockerImageDB in your own code, call db.close() when done.
  • 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)

Table of built distributions (wheels) for docker-diff 0.0.10
File Interpreter ABI Platform
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

Release history Release notifications | RSS feed

This release

0.0.10 This release

1 release file

0.0.9

1 release file

0.0.8

1 release file

0.0.7

1 release file

0.0.6

1 release file

0.0.5

1 release file

0.0.4

1 release file

0.0.3

1 release file

0.0.2

1 release file

0.0.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page