Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does docker use for (image) versioning?

Tags:

git

docker

I am curious. It looks like git to me, but I can't find sources that confirm that. Or does it have it's own revision control system ?

like image 648
Stanimirovv Avatar asked Jun 11 '15 22:06

Stanimirovv


People also ask

Does docker provide version control for docker images?

On top of that, Docker containers work just like GIT repositories, allowing you to commit changes to your Docker images and version control them.

What is the use of image versioning?

Versioning allows engineers to trace changes made in that particular software or image back to changes in source code.

Which of the following is used to manage the images in docker?

The Docker CLI provides commands that are used to customize Docker images.


1 Answers

Docker doesn't internally use git today for any kind of resource versioning. It does however:

  • Rely on hashing to uniquely identify the file system layers: this is what can make it resemble git to the user
  • Take initial inspiration in the notion of commit, pushes and pulls

One thing that makes this super obvious is the docker history command that will show you all successive "commits" (i.e., operations) that make up the image, each with 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                          

One final thing to note is that Docker is moving toward content-addressable layers, so those hash are not randomly generated (like git does) but uniquely identify a given content.

like image 168
icecrime Avatar answered Oct 16 '22 07:10

icecrime