Skip to main content

Export docker image into tar file directly from registry API

Project description

docker-export

PyPI version shields.io CodeFactor License: GPL v3

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-0.3.tar.gz (22.5 kB view details)

Uploaded Source

Built Distribution

docker_export-0.3-py3-none-any.whl (21.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: docker_export-0.3.tar.gz
  • Upload date:
  • Size: 22.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.27.1 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.6

File hashes

Hashes for docker_export-0.3.tar.gz
Algorithm Hash digest
SHA256 2e5469b106a7c5311aea6c15a8d048ccc2dc22990c1d86e8a9f04d2660abbac0
MD5 dd7531cfe9ef57c3380f5dbe8da44e17
BLAKE2b-256 3d0ac47623029ee71b5e24a2ef5b481bba5c4eec6f0748e971d88d0c37047ed0

See more details on using hashes here.

File details

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

File metadata

  • Download URL: docker_export-0.3-py3-none-any.whl
  • Upload date:
  • Size: 21.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.27.1 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.6

File hashes

Hashes for docker_export-0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 17745cf810259b11a33f0540e1b4c6eaa7c377d499f5cd39596bf00dd6f12c31
MD5 fd692de2824d6709fed432d8f2fcceae
BLAKE2b-256 59a58e50df381b096dabbd3ea05f2bd229ea8b73eaa69c9177f2c5025146eea0

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