Building an image docker from layers

57 views Asked by At

I have a scenario when I have 2 systems with limited communication - one of them is a stand alone well protected system that not have an internet connection,the only way to make a file transportation between those system is secured tightly and all communication is scanned for viruses and more.

Because of this, the connection between those two systems is slow and all files transfer are queued, sometimes for hours.

I need to transfer docker images from system A to the secured system B on a daily basis, which make the process extremely slow.

Now I know that docker use layers. Most of the time you can just pull the images and it will build only the changed layers and nothing more, but in my case I don't have such repository connected to both of the systems.

What I want to do is this: Let's say I have a service with tags 1.0.0,latest on system B. Now I want to transfer version 1.0.1 to system B, I would like to take all the hash values of the layers of 1.0.0 (latest) from system B, build version 1.0.1 on system A, get the hash values of each layers of 1.0.1 and compare them with the layers from 1.0.0 and then send just the layers that different between 1.0.0 and 1.0.1

Is this even possible? If not, do you have and advice for me how to fasten the whole process consider that I can't change the way the systems communicate? Thanks in advance.

1

There are 1 answers

0
andmed On BEST ANSWER

You can try docker save to convert your image to tar. Then you can extract it and find the layers you need

Then send layers to B machine (don't forget manifest.json and repositories from machine A) and build an image on machine B