Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

These blobs are already shared. (In Docker) Since each layer is only the diff from the layer before it, the content address is only from the change set.

Technically you can share blobs even between an image that is `FROM centos` and one that is `FROM ubuntu` as long as the layer hashes are the same.

If you have a hierarchical dependency chain, and addressing content based on the content that comes before it in the chain, you can only share blobs between images if they have a common ancestry.



Here's the example I'm thinking of:

One image has a large file at a specific path, added via something like: "COPY largefile /etc/path1".

Another image wants to add this same file to a different location:

"COPY largefile /etc/path2/".

My understanding is that these two blobs will have a different hash and can't be shared because the changeset includes both the file itself, and the destination location in the image.

Is that correct?


Yes, however I'm not sure this would be shared in any format right now.




Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: