-
Notifications
You must be signed in to change notification settings - Fork 787
Closed
Description
I think this was intentional, but I wanted to verify since this changed between rc3 and rc4.
Now that v1.Manifest no longer has a self describing MediaType associated with it, it is incompatible with the docker layout for manifest. This means converting back and forth is a bit trickier. Given an oci manifest origManifest, converting it to docker format (so you can upload it into a v2 registry, for example), used to look like:
manifest := origManifest
manifest.mediaType = "application/vnd.docker.distribution.manifest.v2+json"
manifest.Config.MediaType = "application/vnd.docker.container.image.v1+json"
for _, l := range manifest.Layers {
layer.MediaType = "application/vnd.docker.image.rootfs.diff.tar.gzip"
}Now it is necessary to wrap the manifest in a new version that has the removed field. For example:
type maybeDockerManifest struct {
v1.Manifest
MediaType string `json:"mediaType,omitempty"`
}
manifest := maybeDockerManifest{Manifest: origManifest}
manifest.mediaType = "application/vnd.docker.distribution.manifest.v2+json"
manifest.Config.MediaType = "application/vnd.docker.container.image.v1+json"
for _, l := range manifest.Layers {
layer.MediaType = "application/vnd.docker.image.rootfs.diff.tar.gzip"
}This isn't hugely painful, but I wanted to make sure the ramifications of changing that field and breaking compatiblity are understood.
Metadata
Metadata
Assignees
Labels
No labels