Skip to main content

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

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

docker_diff-0.0.8-py3-none-any.whl (12.9 kB view details)

Uploaded Python 3

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

Hashes for docker_diff-0.0.8-py3-none-any.whl
Algorithm Hash digest
SHA256 6de4bbbccab0ee13ab778bbc7a830b67674bfda796fe045fcf38382fa207b706
MD5 0db702968836098c8c1b1984477cd073
BLAKE2b-256 43e520eb2af01376d34862078438d9bdcb40bba3cbf40608608a3b7d225613c3

See more details on using hashes here.

Provenance

The following attestation bundles were made for docker_diff-0.0.8-py3-none-any.whl:

Publisher: publish.yml on eapolinario/docker-diff

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page