06: docker layered mirror

docker stratified

docker layered mirrored (using kvm linked clone, copy-on-write characteristics)

1: Benefits stratification: reuse, conserve resources

2: The larger the image, the longer migration time; and if you use docker do cluster, if the mirror is too large,

Changes, every update, it will take a long time. Preferably it is a mirror image points 2-3 layers (base system - Application Service - Code), and pre-mining cluster download.

 

View layered mirrored information: ( Please note missing -)

[root@k8s129 ~]# docker history centos_ssh:v1.2 --no-trunc

IMAGE               CREATED             CREATED BY                                      SIZE                COMMENT

275e0f02e6b1        13 days ago         /usr/sbin/sshd -D                               32B                 

185aecfa154d        13 days ago         /bin/bash                                       45.2MB              

0f3e07c0138f        4 weeks ago         /bin/sh -c #(nop)  CMD ["/bin/bash"]            0B                  

<missing>           4 weeks ago         /bin/sh -c #(nop)  LABEL org.label-schema.sc…   0B                  

<missing>           4 weeks ago         /bin/sh -c #(nop) ADD file:d6fdacc1972df524a…   220MB    

How to achieve

As for how to get the container mirror layer file without affecting the layer is a mirror image of it? docker is accomplished?
If you need to get a file, the container will have the top down to the next layer of the mirror layer to get the file, if the layer file does not exist, it will go to the next level to find a mirror, until the last layer.
For the user, the user-oriented is an overlay file system.

 

And for any file operations will be recorded in the container layer, said modification e.g. document, the container layer will be found in the image files are copied into the layer of the container layer is then modified, deleted records will be deleted file is recorded in a file container layer.

Probably schematics:

Based on our earlier centos mirror, layer by layer made several mirrored

note:

The actual production of the mirror, we should by the amount of the change will take place on the last layer, which can go in front of the buffer layer. (Such as the FIG: first make httpd and sshd , first make sshd and httpd difference)

 

 

 

 attach:

Docker overall process:

 

Guess you like

Origin www.cnblogs.com/jim-xu/p/11785882.html