Coder Social home page Coder Social logo

docker-export's People

Contributors

kelson42 avatar rgaudin avatar

Stargazers

 avatar

Watchers

 avatar  avatar

docker-export's Issues

Better error message if platform is not available

I have experimented two kinds of failures which, at the first sight, were a bit puzzling to me:

  • is single platform and mismatches
  • v1 single platform and mismatches #3

I finally have understood what goes wrong, but I believe we could easier help the user to understand the problem.

I propose to add a line after the error(s) stating the requested platform and (if possible) the list of possible platforms provided. It could look like: Requested platform is "linux/arm/v7', but available paltform(s) is/are: "linux/arm/...", "linux/x86/..."

Unable to export openzim/gutenberg (v1 single platform and mismatches)

$ docker-export openzim/gutenberg gutenberg.image.tar
INFO:Starting index.docker.io/openzim/gutenberg:latest (linux/arm/v7) export into /home/kelson/code/docker-export/gutenberg.image.tar
ERROR:FAILED. An error occurred: index.docker.io/openzim/gutenberg:latest is v1 single platform and mismatches
ERROR:index.docker.io/openzim/gutenberg:latest is v1 single platform and mismatches
Traceback (most recent call last):
  File "/home/kelson/.local/lib/python3.10/site-packages/docker_export/__init__.py", line 730, in main
    export(image=image, platform=platform, to=dest, build_dir=build_dir)
  File "/home/kelson/.local/lib/python3.10/site-packages/docker_export/__init__.py", line 641, in export
    manifest = get_layers_manifest(image=image, platform=platform, auth=auth)
  File "/home/kelson/.local/lib/python3.10/site-packages/docker_export/__init__.py", line 369, in get_layers_manifest
    return get_layers_from_v1_manifest(
  File "/home/kelson/.local/lib/python3.10/site-packages/docker_export/__init__.py", line 339, in get_layers_from_v1_manifest
    raise ValueError(f"{image} is v1 single platform and mismatches")
ValueError: index.docker.io/openzim/gutenberg:latest is v1 single platform and mismatches

Improve the usage()

I believe the usage() would benefit of a one line per option.

It would be good as well to give "as example", the 2 or 3 most commons platforms.

Indicating that linux/arm/v7 is the default one would be useful as well.

Add Changelog

V0.3 is in preparation, it is time to add a Changelog file

image name and tag seem to vanish

Once I have exported a Docker image from a repository to a tarball, then I tried to import them with docker import.

It seems the images are imported, but tagging and naming have vanished:

$ docker images
REPOSITORY                            TAG                IMAGE ID       CREATED              SIZE
<none>                                <none>             4055866b7589   About a minute ago   69.4MB
<none>                                <none>             de5bee81a7a4   2 hours ago          458MB
<none>                                <none>             ad9cf59ba1f9   6 hours ago          2.07GB

invalid character 'p' after top-level value

I have exported an image:

invalid character 'p' after top-level value

But if I try to load it, I get:

$ docker load < youtube.image.tar 
invalid character 'p' after top-level value

Error by retrieving image of kiwix/kiwix-serve

$ docker-export kiwix/kiwix-serve kiwix-serve.image
INFO:Starting index.docker.io/kiwix/kiwix-serve:latest (linux/arm/v7) export into /home/kelson/code/docker-export/kiwix-serve.image/index.docker.io_kiwix_kiwix-serve.tar
INFO:Exporting 7 layers (25.87 MiB) into /tmp/index.docker.io_kiwix_kiwix-servehvy_rw7t.tmp
INFO:> [6366ba92f08e] Downloading 2.3 MiB…
[Elapsed Time: 0:00:00]   2.3 MiB|####################################################################################################|176.2 MiB/s (Time:  0:00:00)
INFO:> [6366ba92f08e] Extracting...
INFO:> [6366ba92f08e] Adding metadata…
INFO:> [bd697ce7ae80] Downloading 34.26 KiB…
[Elapsed Time: 0:00:00]  34.3 KiB|####################################################################################################| 33.3 MiB/s (Time:  0:00:00)
INFO:> [bd697ce7ae80] Extracting...
INFO:> [bd697ce7ae80] Adding metadata…
INFO:> [21ad945d3e50] Downloading 147 bytes…
[Elapsed Time: 0:00:00] 147.0 B|######################################################################################################|196.9 KiB/s (Time:  0:00:00)
INFO:> [21ad945d3e50] Extracting...
INFO:> [21ad945d3e50] Adding metadata…
INFO:> [1b82e75e5b92] Downloading 150 bytes…
[Elapsed Time: 0:00:00] 150.0 B|######################################################################################################|125.2 KiB/s (Time:  0:00:00)
INFO:> [1b82e75e5b92] Extracting...
INFO:> [1b82e75e5b92] Adding metadata…
INFO:> [daee9ad170fd] Downloading 23.54 MiB…
[Elapsed Time: 0:00:00]  23.5 MiB|####################################################################################################| 45.8 MiB/s (Time:  0:00:00)
INFO:> [daee9ad170fd] Extracting...
INFO:> [daee9ad170fd] Adding metadata…
INFO:> [c784ac0d1cc4] Downloading 100 bytes…
[Elapsed Time: 0:00:00] 100.0 B|######################################################################################################|140.3 KiB/s (Time:  0:00:00)
INFO:> [c784ac0d1cc4] Extracting...
INFO:> [c784ac0d1cc4] Adding metadata…
INFO:> [2b134fb39279] Downloading 435 bytes…
[Elapsed Time: 0:00:00] 435.0 B|######################################################################################################|520.6 KiB/s (Time:  0:00:00)
INFO:> [2b134fb39279] Extracting...
INFO:> [2b134fb39279] Adding metadata…
INFO:Adding Image metadata…
INFO:Creating archive at /home/kelson/code/docker-export/kiwix-serve.image/index.docker.io_kiwix_kiwix-serve.tar
ERROR:FAILED. An error occurred: [Errno 2] No such file or directory: '/home/kelson/code/docker-export/kiwix-serve.image/index.docker.io_kiwix_kiwix-serve.tar'
ERROR:[Errno 2] No such file or directory: '/home/kelson/code/docker-export/kiwix-serve.image/index.docker.io_kiwix_kiwix-serve.tar'
Traceback (most recent call last):
  File "/home/kelson/.local/lib/python3.10/site-packages/docker_export/__init__.py", line 730, in main
    export(image=image, platform=platform, to=dest, build_dir=build_dir)
  File "/home/kelson/.local/lib/python3.10/site-packages/docker_export/__init__.py", line 647, in export
    export_layers(
  File "/home/kelson/.local/lib/python3.10/site-packages/docker_export/__init__.py", line 613, in export_layers
    bundle_image(
  File "/home/kelson/.local/lib/python3.10/site-packages/docker_export/__init__.py", line 551, in bundle_image
    with tarfile.open(target, "w") as tar:
  File "/usr/lib/python3.10/tarfile.py", line 1662, in open
    return cls.taropen(name, mode, fileobj, **kwargs)
  File "/usr/lib/python3.10/tarfile.py", line 1672, in taropen
    return cls(name, mode, fileobj, **kwargs)
  File "/usr/lib/python3.10/tarfile.py", line 1484, in __init__
    fileobj = bltn_open(name, self._mode)
FileNotFoundError: [Errno 2] No such file or directory: '/home/kelson/code/docker-export/kiwix-serve.image/index.docker.io_kiwix_kiwix-serve.tar'

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.