Generate and apply diffs between Docker image tar archives
Project description
docker-image-diff
A tool to generate and apply diffs between Docker image tar archives, allowing you to package only the updated parts for offline updates.
Features
- Diff: Create a diff tar containing only files added or changed between two Docker image tar files.
- Merge: Merge a diff tar back into a base tar to reconstruct the updated image.
- Prints size summary for base, new, and diff archives.
Requirements
- Python 3.10 or above
- Standard library only (no external dependencies)
Installation
If published on PyPI, install with:
pip install docker-image-diff
Or to use from source:
git clone <repo-url>
cd docker-image-diff
pip install .
Usage
# Generate a diff archive:
dockerdiff diff --base <base tar path> --new <new tar path> --output <diff tar path>
# Merge a diff archive into the base to create the updated image:
dockerdiff merge --base <base tar path> --diff <diff tar path> --output <new tar path>
Examples
# Create a diff between two images:
$ dockerdiff diff --base ubuntu_old.tar --new ubuntu_new.tar --output ubuntu_diff.tar
# Reconstruct the updated image on an offline server:
$ dockerdiff merge --base ubuntu_old.tar --diff ubuntu_diff.tar --output ubuntu_reconstructed.tar
Output
After running a command, the tool prints a summary of the archive sizes:
Base image size: 123.45 MB
New image size: 130.67 MB
Diff image size: 7.22 MB
Use these numbers to verify that only the changed content was packaged.
Author
Junghyun Kwon
Version
0.1.0
License
This project is licensed under the Apache License 2.0.
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 Distribution
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_image_diff-0.1.0.tar.gz.
File metadata
- Download URL: docker_image_diff-0.1.0.tar.gz
- Upload date:
- Size: 7.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a5a9af434da2def79885b8375eaa40d22ab35b8c38bea5d7b30abd63d369b729
|
|
| MD5 |
2bf45add7ff55779d99adf6b3032e644
|
|
| BLAKE2b-256 |
ce2440996805a4bb6a1c1ad58b4df5423bc19ae78bb38d3933cad9a55ccc29c5
|
File details
Details for the file docker_image_diff-0.1.0-py3-none-any.whl.
File metadata
- Download URL: docker_image_diff-0.1.0-py3-none-any.whl
- Upload date:
- Size: 8.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1f0e8942cb9766eabc7f7369350b8b098c10e5ce477b56aaef2a12abef1ab03f
|
|
| MD5 |
1bfee7121ab8ce0121c98e1f63681982
|
|
| BLAKE2b-256 |
0750970ca49b5d942762d10f57a45483cf32eeb10f27580077c45ba76cc4db0e
|