New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Calculate checksum when installing image layers #8249
Conversation
@@ -32,6 +33,7 @@ type Image struct { | |||
Config *runconfig.Config `json:"config,omitempty"` | |||
Architecture string `json:"architecture,omitempty"` | |||
OS string `json:"os,omitempty"` | |||
Checksum string `json:"checksum"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we want this information to be pushed on the registry & available on docker inspect
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will be pushed to the registry as part of the image json and available when inspecting an image and requesting raw json. We do want it available as it is very important to the goals for #8093
Lots of deletions, I like it! |
@vieux @crosbymichael as a proof of backwards compatibility, I've pushed my own build of busybox:
you should be able to pull with docker 1.2 and manually check Edit: if you're going to check the image IDs, here are the IDs that you should get after pulling (in order of base to leaf layer):
and their respective tarsums:
|
wait... Wait a minute..... WAIT! 3 of those tarsums should be the same.... They should all be the tarsum of an empty change set, i.e., |
@dmcgowan I think this issue will affect how/when we compute the checksums for layers. Computing it on commit/load/import/pull should be okay, but we'll also need to compute it when doing a push/save/export. This is because the tarsum of the layer will change from one graphdriver to the next. exemplified above, AUFS generates the |
ping @jlhawn |
Reping @jlhawn |
hi. I starting working on this a bit more as of yesterday. I think there may be a safe way for the aufs driver to export/import a layer without exporting/importing the |
f837656
to
c5e77f3
Compare
@vieux @tiborvass @dmcgowan I'm running into a few details/issues that I am unsure of how to resolve and are major blockers for me.
EDIT: no |
For issue 2, tested on my Fedora machine and cp -a preserved the modified timestamps. Kernel: 3.16.6 |
@dmcgowan and I have discussed some possible solutions to this issue that would affect Docker in different ways depending on how we decide to get around the above system/driver dependent checksum.
Personally, I prefer option |
Adds a new `Checksum` field to the current image format to store the result of the tarsum of the file system changes. Signed-off-by: Josh Hawn <josh.hawn@docker.com> (github: jlhawn)
The argument specified the json data to save to disk when registering a new image into the image graph. If it is nil, then the given image is serialized to json and that is written by default. This default behavior is sufficient because the given image was originally deserialzed from this jsonData to begin with. Signed-off-by: Josh Hawn <josh.hawn@docker.com> (github: jlhawn)
A quick grep of the code base shows that the "image_set" job registered by the TagStore is not used. Signed-off-by: Josh Hawn <josh.hawn@docker.com> (github: jlhawn)
Also includes Checksum field in `docker inspect` output for images. Correcly close layerData decompress/reader wrapper when storing images. Remove imgJSON from call to graph.Register when pulling an image. Docker-DCO-1.1-Signed-off-by: Josh Hawn <josh.hawn@docker.com> (github: jlhawn)
I'm breaking this PR up into multiple PRs so I may continue work on other issues. I've also thought of a potential way around the 'shell out to |
Hey all, I'm closing this issue for now in lieu of various other PRs that I've been submitting. I'll submit a proposal for the option 2 that I outlined above. |
Compute TarSum of image layer data when installing
Checksum
field to the current image format to store the result of the tarsum of the file system changes.Remove
jsonData
argument fromimage.StoreImage
from this jsonData to begin with.
Remove unused "image_set" job
work towards #8093