Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What checksum does Docker use for caching COPY?

I am trying to debug a Docker cache issue and I want to check if the cache should match.

Step 7 : COPY myfile /home/me/myfile
 ---> daa0799b47df

What does the above ID represent? It doesn't seem to be part of a md5 or sha1 checksum. Can I run a command to check this?

like image 896
Rimian Avatar asked Sep 06 '25 20:09

Rimian


1 Answers

It is random bytes, hex encoded. This is the short form returned by https://github.com/moby/moby/blob/0eefae8e0db0c3c567e8807f09434a0da3fc1261/utils/utils.go#L171 and generated by https://github.com/moby/moby/blob/0eefae8e0db0c3c567e8807f09434a0da3fc1261/utils/utils.go#L180. It is not a checksum and once again is random. It is simply used to identify images and containers.

like image 52
creack Avatar answered Sep 10 '25 08:09

creack