aidanhs/dlgrab

No working(Of course) with Docker 19.03.5, got any new ideas?

Closed this issue · 1 comments

The present output is:

vagrant@ubuntu-xenial:~/dlgrab$ docker history hello-world:latest
IMAGE               CREATED             CREATED BY                                      SIZE                COMMENT
fce289e99eb9        10 months ago       /bin/sh -c #(nop)  CMD ["/hello"]               0B
<missing>           10 months ago       /bin/sh -c #(nop) COPY file:f77490f70ce51da2…   1.84kB

vagrant@ubuntu-xenial:~/dlgrab$ ./dlgrab fce
Full layer id found: sha256:fce289e99eb9bca977dae136fbe2a82b6b7d4c372474c9235adc1741675f587e
Layer folder will be dumped into .
ERROR error parsing HTTP 404 response body: invalid character 'p' after top-level value: "404 page not found\n"

I've went through the Docker/Moby docs and issues, but found no api supported from Docker Engine to extract a specific layer.The only way I can do is to a little bit of hack to the docker save implementation in docker-engine.

Is there any new idea or suggestion to do this now without modifying the engine?

Docker changed the way images work so that there is no longer a 1-1 mapping between a layer and a blob of data, and I no longer had the need for dlgrab. I also haven't sat down to spend the time understanding the new image format fully.

The short of it is that there is probably no equivalent (or at least, no well know equivalent), because dlgrab is such a dirty hack (it lies to Docker and says "yeah I have all this other stuff, just send me that one layer").

That said, there are a wealth of tools that have popped up in the wake of the Open Container Initiative and I expect it should be possible to craft something similar courtesy of the standardisation that Docker must now adhere to. Off the top of my head, I'd alter the dlgrab process to:

  • create the manifest for an OCI image that references the blobs you want from docker and docker load it - docker load should transparently use the blobs that it already has stored
  • docker save that just-loaded image, which will now include the data you were looking for
  • use oci-image-tool-unpack or whatever to continue your manipulations

Some links for future readers:

Good luck!