Metadata-Version: 2.1
Name: docker-export
Version: 1.0.1
Summary: Export docker image into tar file directly from registry API
Project-URL: Homepage, https://github.com/offspot/docker-export
Project-URL: Donate, https://www.kiwix.org/en/support-us/
Author-email: Kiwix <dev@kiwix.org>
License: GPL-3.0-or-later
License-File: LICENSE
Keywords: docker,image,kiwix,oci
Classifier: License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Requires-Python: >=3.8
Requires-Dist: requests<3,>=2
Provides-Extra: check
Requires-Dist: pyright==1.1.321; extra == 'check'
Provides-Extra: dev
Requires-Dist: debugpy==1.6.7; extra == 'dev'
Requires-Dist: docker-export[all]; extra == 'dev'
Requires-Dist: docker-export[check]; extra == 'dev'
Requires-Dist: docker-export[lint]; extra == 'dev'
Requires-Dist: docker-export[scripts]; extra == 'dev'
Requires-Dist: docker-export[test]; extra == 'dev'
Requires-Dist: pre-commit==3.3.3; extra == 'dev'
Provides-Extra: lint
Requires-Dist: black==23.7.0; extra == 'lint'
Requires-Dist: ruff==0.0.282; extra == 'lint'
Provides-Extra: scripts
Requires-Dist: invoke==2.2.0; extra == 'scripts'
Provides-Extra: test
Requires-Dist: coverage==7.2.7; extra == 'test'
Requires-Dist: pytest==7.4.0; extra == 'test'
Provides-Extra: visual
Requires-Dist: humanfriendly>=8.0; extra == 'visual'
Requires-Dist: progressbar2>=4.0; extra == 'visual'
Description-Content-Type: text/markdown

# docker-export

[![CodeFactor](https://www.codefactor.io/repository/github/offspot/docker-export/badge)](https://www.codefactor.io/repository/github/offspot/docker-export)
[![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0)
[![codecov](https://codecov.io/gh/offspot/docker-export/branch/main/graph/badge.svg)](https://codecov.io/gh/offspot/docker-export)
[![PyPI version shields.io](https://img.shields.io/pypi/v/docker-export.svg)](https://pypi.org/project/docker-export/)
[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/docker-export.svg)](https://pypi.org/project/docker-export)

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.


```bash
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

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

### Python module

```py
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:

```sh
docker load -i IMAGE.tar

# verify it's been properly added
docker images
```
