docker-save-last Command Line Utility
This is a command line utility effectively replicating docker save except that it will only save the LAST layer of the image in the output archive.
This is especially useful when combined with the experimental docker build --squash option, because it allows you to export only your changes on top of the base image without the entire base image file system in the output archive.
This means HUGE savings in file size.
General discussion on the issue can be found here: https://github.com/moby/moby/issues/8039
Installation
Use pip to install:
pip install d-save-last
Required Dependencies
dockerinstalled, on the PATH, and usable without sudo.
Usage
Typical usage will look like d-save-last -o ./path/to/output.tar YOUR_IMAGE_ID
Arguments and options are identical to docker save see docker save --help.
$ docker save -h
Usage: docker save [OPTIONS] IMAGE [IMAGE...]
Save one or more images to a tar archive (streamed to STDOUT by default)
Options:
-o, --output string Write to a file, instead of STDOUT
How does it work?
This utility uses the special docker-in-docker image from https://github.com/brthor/dind-save
That docker image contains a version of the docker daemon with patches to docker save built from https://github.com/brthor/engine
The utility launches the dind-save image in a container, and connects to its docker daemon over TCP.
Caveats
-
This is currently only tested with host machines that use the overlay2 storage driver. Any other storage driver will almost certainly not work.
-
Currently only supports docker version 18.09. Adding new versions requires changes in the docker daemon and
dind-saveimage repository. Open an issue if you'd like a new version added for your purposes.
Feel free to contribute here if any of these are an issue and you'd like to use this utility. Pull Requests will be reviewed quickly.
Metadata
Release files for d-save-last 0.1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| d-save-last-0.1.2.tar.gz | 4.0 kB | Without provenance | Details for d-save-last-0.1.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| d_save_last-0.1.2-py2-none-any.whl | Python 2 | none | any | Details for d_save_last-0.1.2-py2-none-any.whl |
Total release size: 10.0 kB
Release files / d-save-last-0.1.2.tar.gz
| Download URL | d-save-last-0.1.2.tar.gz |
|---|---|
| Size | 4.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ee6fdf55b8f6615c803c95d3b724363a4e8cea20f40cc651510e97b1559dd60c
|
|
BLAKE2b-256 checksum How to use checksums |
4e8e053003b25bfbea74c8f49322c8b7d1dceaafd918a1c88525cce917202853
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.9.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/2.7.10
|
Release files / d_save_last-0.1.2-py2-none-any.whl
| Download URL | d_save_last-0.1.2-py2-none-any.whl |
|---|---|
| Size | 6.0 kB |
| Tags | Python 2 |
|
SHA-256 checksum How to use checksums |
a4352c06e6c2c87e524e67b20b19b3ad8b828dc987e1082e0153f8380b7c37ad
|
|
BLAKE2b-256 checksum How to use checksums |
55a40b70ca988343bf899b0dcceddb6919a2452994d9f74a334638c629517a43
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.9.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/2.7.10
|
Security for d-save-last 0.1.2
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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.