An efficient Docker image transfer system that extracts the diff of two images and loads only the diff into the server. (designed for offline docker users)

git clone https://github.com/junwha/DockerDiff
echo "export PATH=$(pwd)/DockerDiff:\$PATH" >> ~/.bashrc && source ~/.bashrc
-
Push the base image into the offline registry server
i. Run the registry server
ddiff server
(optional, you can use your own server by setting the env variable DDIFF_URL)ii.
ddiff push <base tag>
-
Run the ddiff server, and build a new image on top of the base image.
i. Write a Dockerfile with
FROM <base tag>
ii. Run the registry server
ddiff server
. This will generate the diff file<new>-<version>.tar.gz
ddiff build -t <new tag>:<version> ./
-
Transfer only the diff file (
<new tag>-<version>.tar.gz
) to the offline server -
Load the diff file at the offline server
ddiff load <new tag>-<version>.tar.gz
-
Make a diff file (
<new tag>-<version>.tar.gz
) of the target image from the base imageddiff diff <base tag> <target tag>
-
Transfer the diff file and load at the offline server
ddiff load <new tag>-<version>.tar.gz
-
Modify the existing Dockerfile or make a new Dockerfile on top of the image in the offline (FROM :)
-
Build the Dockerfile with ddiff
ddiff build -t <offline tag>:<new version> ./
-
Transfer the diff file and load at the offline server
ddiff load <offline tag>-<new version>.tar.gz
Usage: ddiff <command> <args...>
Commands
server
- Run the registry serverpush
<tag 1> ... <tag n>
- Push one or more imagespull
<tag 1> ... <tag n>
- Pull one or more imagesdiff
<base> <target>
- Diff the target image from the base imageload
<tar file>
- Load the target image from diff filebuild
<args>
- Build the image and diff from base (FROM ...)
For easier sharing of base images, DockerDiff provides several pre-configured base images:
- ddiff-base: A CUDA base image with essential tools (e.g., Git, Vim, OpenSSH).
- ddiff-base-py: A Conda-based image with a specific Python version, built on
ddiff-base
. - ddiff-base-torch: A PyTorch image with a specific Python version, built on
ddiff-base-py
.
- Python 3.X