8000 docker pull is more restrictive now w.r.t. MediaTypes · Issue #30083 · moby/moby · GitHub
[go: up one dir, main page]

Skip to content

docker pull is more restrictive now w.r.t. MediaTypes #30083

@duglin

Description

@duglin

Using docker v1.14.0 (master) I see this:

$ docker pull gcr.io/kubernetes-helm/tiller:v2.1.3
Error response from daemon: target is unknown

After some digging, this error is coming from:
https://github.com/docker/docker/blob/master/distribution/pull_v2.go#L366

		if !allowedMediatype {
			configClass := mediaTypeClasses[m.Manifest.Config.MediaType]
			if configClass == "" {
				configClass = "unknown"
			}
			return false, fmt.Errorf("target is %s", configClass)
		}

And the MediaType being returned from gcr.io is "text/html".

I believe in older version of this code we never checked the mediaType to see if its valid and that's why this works on older Dockers. I'm in talks with the gcr.io guys to see if they can fix their code so that they return a valid value, but in the meantime we may want to consider being more forgiving in our code to allow for non-compliant registries.

Or, in @stevvooe's words:
we should probably have a set of media types that revert to some default (like schema2)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0