What does docker use for (image) version control?

I am curious. For me it looks like git, but I can not find sources to confirm this. Or does he have his own version control system?

+6
source share
1 answer

Docker today does not use git for any resource versioning. Nonetheless:

  • Rely on hashing to uniquely identify file system levels: this is what can make it look like git to a user
  • Take the initial inspiration in the concept of commit , push and pull

One thing that makes this super obvious is the docker history , which will show you all the successive “commits” (ie operations) that make up the image, each of which has an individual hash:

 $ docker history dev IMAGE CREATED CREATED BY SIZE COMMENT 437e07e119e1 11 minutes ago /bin/sh -c #(nop) COPY dir:3c72cf7559b6aeff6b 80.23 MB 92b739339069 7 hours ago /bin/sh -c #(nop) ENTRYPOINT &{["hack/dind"]} 0 B 07ed6f8a66d7 7 hours ago /bin/sh -c set -x && git clone https://gi 4.462 MB 0a7eacf986e3 7 hours ago /bin/sh -c #(nop) ENV RSRC_COMMIT=e48dbf1b7fc 0 B 41478ca01b73 7 hours ago /bin/sh -c set -x && export GOPATH="$(mktemp 2.689 MB 070d4d30261e 7 hours ago /bin/sh -c #(nop) ENV TOMLV_COMMIT=9baf8a8a9f 0 B e75c29475d7a 7 hours ago /bin/sh -c set -x && export GOPATH="$(mktemp 3.227 MB 857a0ec21751 7 hours ago /bin/sh -c ./contrib/download-frozen-image.sh 3.59 MB e936f5546782 7 hours ago /bin/sh -c #(nop) COPY file:5d664ff5e9669851c 3.866 kB 0d12674bd0af 7 hours ago /bin/sh -c ln -sv $PWD/contrib/completion/bas 0 B ef858f6d9027 7 hours ago /bin/sh -c ln -sfv $PWD/.bashrc ~/.bashrc 0 B 287721a0a2b6 7 hours ago /bin/sh -c #(nop) ENV DOCKER_BUILDTAGS=apparm 0 B 

It should be noted that Docker moves to content-addressable layers, so these hashes are not randomly generated ( like git does ), but uniquely identifies this content.

+5
source

Source: https://habr.com/ru/post/988958/


All Articles