-
Notifications
You must be signed in to change notification settings - Fork 35
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
Bug in image reference handling in Docker Driver #145
Comments
To me @radu-matei @glyn please correct me if I'm wrong. |
Interestingly its serialized as contentDigest: Looks like Porter is using it for the Digested Reference. Either way one of the implementations seems to be wrong and it would be useful to clarify |
I think we need to think about this carefully to avoid confusion. Let's start with some definitions (based on the "OCI Image Format Specification"). Docker and OCI images have two types of digest: a repo digest and an image id. A repo digest is the SHA-256 digest of the compressed image manifest. Since compression depends on the implementation of the registry used to store the image, the repo digest doesn't logically exist until the image has been pushed. An image id, on the other hand, is the SHA-256 digest of the uncompressed image configuration, which is independent of the registry implementation. Both these digests are content addresses of an image in the sense that each uniquely identifies the content (modulo SHA-256 collisions). Note that the docker registry spec refers to the repo digest as a "content digest". The CNAB spec defines the
and then for images other than invocation images:
Since both repo digests and image ids are roots of Merkle trees, the CNAB spec doesn't actually prescribe whether repo digest or image id (or indeed some other Merkle tree root digest!) should be used for Regardless of which definition we choose, it seems clear that we can't simply append the There is an efficiency consideration. If a repo digest is used as
|
There is a bug in the way that the docker driver deals with Image references, it ignores any digest value and just use op.Image.Image:
https://github.com/deislabs/cnab-go/blob/26ed63f06aff506ab4bfea63a2a83d341f987580/driver/docker/docker.go#L158-L182
The Kubernetes Driver seems to do this correctly:
https://github.com/deislabs/cnab-go/blob/26ed63f06aff506ab4bfea63a2a83d341f987580/driver/kubernetes/kubernetes.go#L417-L422
Also see #144
The text was updated successfully, but these errors were encountered: