Skip to main content

Export docker image into tar file directly from registry API

Project description

docker-export

CodeFactor License: GPL v3 codecov PyPI version shields.io PyPI - Python Version

Export Docker Images (v2 manifests only) to a single .tar, without docker; Using Python and the registry's API.

Usages

Installation

docker-export is a Python3 software. You are advised to use it in a virtual environment to avoid installing software dependencies on your system.

python3 -m venv ./env  # creates a virtual python environment in ./env folder
./env/bin/pip install -U pip  # upgrade pip (package manager). recommended
./env/bin/pip install -U docker-export[all]  # install/upgrade docker-export inside virtualenv

# direct access to in-virtualenv docker-export binary, without shell-attachment
./env/bin/docker-export --help
# alias or link it for convenience
sudo ln -s $(pwd)/env/bin/docker-export /usr/local/bin/

# alternatively, attach virtualenv to shell
source env/bin/activate
docker-export --help
deactivate  # unloads virtualenv from shell

Command line

docker-export --platform linux/arm/v7 ghcr.io/kiwix/kiwix-tools:3.0.0 kiwix-tools.tar

Python module

import pathlib

from docker_export import Platform, Image, export

export(
    image=Image.parse("kiwix/kiwix-tools:3.3.0"),
    platform=Platform.auto(),
    to=pathlib.Path("kiwix-tools.tar"),
)

Using exported image

Exported images (tarball) are loaded into dockerd via:

docker load -i IMAGE.tar

# verify it's been properly added
docker images

Project details


Download files

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

Source Distribution

docker_export-1.0.0.tar.gz (28.5 kB view details)

Uploaded Source

Built Distribution

docker_export-1.0.0-py3-none-any.whl (22.3 kB view details)

Uploaded Python 3

File details

Details for the file docker_export-1.0.0.tar.gz.

File metadata

  • Download URL: docker_export-1.0.0.tar.gz
  • Upload date:
  • Size: 28.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/4.0.2 CPython/3.11.4

File hashes

Hashes for docker_export-1.0.0.tar.gz
Algorithm Hash digest
SHA256 93f244b8f4bb4e2aacb735fb392edb899fb32c16016c8e2543eafa978e4f6741
MD5 632371110b8ffa126b103f6784e34a62
BLAKE2b-256 7476113ea82ad2c6bfac21e79ca58f20ca31481ef92fc1390b7d4eab9680ef80

See more details on using hashes here.

File details

Details for the file docker_export-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for docker_export-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ff55380180a0320da4f7fa2d83c78b54ef295e947c1222c05498020443d4700c
MD5 c37815f3e25b95d853132dfebc8e5fb3
BLAKE2b-256 19f6ceec8d959b7a17561e02e2feac4ce45691701a4fd76f4f6f17a6cc0afa45

See more details on using hashes here.

Supported by

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