0

I want to push an image from my local machine to a remote private Docker registry, but I need to do it as part of a Gatling perf test (using Scala), it means, using the Docker API, I've found some documentation on how to compose the request, but I didn't find anything regarding how to get the layers in Mac Os because in this OS the layers are not actual files (as they are for Linux) but are part of a big "Docker.raw" file.

Any ideas/tools on how to get the layers to be able to put them as part of the PUT requests?

EDIT:

Finally, I was able to overcome this problem by saving the image and then uncompressing it, the layers are under some "hash folders". Part of the script that does it contains the next:

docker image save $imageName -o exported.tar
tar xzf exported.tar -C folderToSeeLayers

The layers are in .tar format

  • Even on native Linux, you shouldn't see the layers as files _per se_; you should be dealing with the Docker API and ignoring the contents of the `/var/lib/docker` directory. Do you have a code sample that works on Linux, but doesn't work on MacOS? – David Maze Jan 04 '21 at 20:11
  • I had to change the approach, as I've seen some Linux solutions in which they can access directly the layer.tar files (unfortunately right now I don't have any of them), in Mac is not possible but I work around this by doing something like the next: docker image save -o .tar tar xzf .tar -C Then in the layers, manifest, etc, are available. I know that might not be the best but worked for me, – Cristian Moyano Jan 05 '21 at 22:41

0 Answers0