An efficient Docker image transfer system that extracts and merges necessary image layers. (designed for offline docker users)
Step 1: Clone and run the DockerSlice system (dslice base run
) on both your online and offline servers. This will set up the DockerSlice registry.
Step 2: You can use DockerSlice in two ways:
A. Share a Common Base Image:
-
Push the base images to both servers.
dslice push junwha/dslice-base-torch:py3.10-torch2.4.1
-
Build custom images on top of the shared base images.
Start with
FROM junwha/dslice-base-torch:py3.10-torch2.4.1
at the top of the Dockerfiledocker build -t <TAG> ./
-
Save the above layers as a tar.gz file
dslice save <TAG>
(<TAG>.tar.gz
will be created) -
Transfer only the new layers (
<TAG>.tar.gz
) above the base, minimizing data transfer. -
Load the tar.gz file at the offline server
dslice load <TAG>.tar.gz
B. Partial Updates:
- When a Docker image on the offline server needs an update, make an update on the image online (e.g., install a package).
- Then, move only the updated layers to the offline server.
./dslice {base|push|pull|delete|save|build|load}
- base {save|load}
- run ([volume folder]): run dslice registry (online server)
- save [base tarball path]: save dslice registry with base images as a tarball
- load [base tarball] ([install directory]): load dslice registry from the tarball
- pull [TAG1] [TAG2] ... [TAGN]: pull one or more images as base images
- push [TAG1] [TAG2] ... [TAGN]: push one or more images into the registry
- pull [TAG1] [TAG2] ... [TAGN]: pull one or more images from the registry
- delete [TAG1]: delete the specified image from the registry
- save [TAG]:
- push the image into registry and exclude mounted blobs from target blobs
- copy target blobs and image manifest
- archive the partial image
- build [docker build args]:
- build an image from Dockerfile (docker build)
- save image as a tarball (save)
- load [image tarball]:
- extract the image to the registry (blobs, manifest)
- restart the container and pull the image the local
For easier sharing of base images, DockerSlice provides several pre-configured base images:
- dslice-base: A CUDA base image with essential tools (e.g., Git, Vim, OpenSSH).
- dslice-base-py: A Conda-based image with a specific Python version, built on
dslice-base
. - dslice-base-torch: A PyTorch image with a specific Python version, built on
dslice-base-py
.