[ 
https://issues.apache.org/jira/browse/MESOS-9703?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16815145#comment-16815145
 ] 

Qian Zhang edited comment on MESOS-9703 at 4/11/19 7:51 AM:
------------------------------------------------------------

Currently in Docker the external URLs is only supported on Windows but not 
other OS, see [this PR|https://github.com/moby/moby/pull/22866] for details. 
And I see there is [another PR|https://github.com/moby/moby/pull/23014] tried 
to support external URLs for other OS, but that PR was closed somehow.

In the [`open` method in 
pull_v2_windows.go|https://github.com/moby/moby/blob/67fdf574d5acd6ddccb6ece0ffe0ace1c1608712/distribution/pull_v2_windows.go#L25:L57],
 we can see Docker tries layer's digest first, but if it is not accessible from 
registry, then it tries the external URLs one by one until an external URL is 
accessible. But in the [`open` method in 
pull_v2_unix.go|https://github.com/moby/moby/blob/05bd04350b8348b3c3bbe3156420257313e4e804/distribution/pull_v2_unix.go#L16:L19],
 only layer's digest will be tried. So external URLs is only used on Window but 
ignored on Unix-like OS. And in the [`Descriptor` method in 
pull_v2_windows.go|https://github.com/moby/moby/blob/67fdf574d5acd6ddccb6ece0ffe0ace1c1608712/distribution/pull_v2_windows.go#L18:L23],
 we can see the external URLs will only be used when the layer's media type is 
`application/vnd.docker.image.rootfs.foreign.diff.tar.gzip` otherwise it will 
be just ignored.


was (Author: qianzhang):
Currently in Docker the external URLs is only supported on Windows but not 
other OS, see [this PR|https://github.com/moby/moby/pull/22866] for details. 
And I see there is [another PR|https://github.com/moby/moby/pull/23014] tried 
to support external URLs for other OS, but that PR was closed somehow.

In the [`open` method of 
pull_v2_windows.go|https://github.com/moby/moby/blob/67fdf574d5acd6ddccb6ece0ffe0ace1c1608712/distribution/pull_v2_windows.go#L25:L57],
 we can see Docker tries layer's digest first, but if it is not accessible from 
registry, then it tries the external URLs one by one until an external URL is 
accessible. But in the [`open` method of 
pull_v2_unix.go|https://github.com/moby/moby/blob/05bd04350b8348b3c3bbe3156420257313e4e804/distribution/pull_v2_unix.go#L16:L19],
 only layer's digest will be tried. So external URLs is only used on Window but 
ignored on Unix-like OS.

> Support docker manifest v2s2 external urls.
> -------------------------------------------
>
>                 Key: MESOS-9703
>                 URL: https://issues.apache.org/jira/browse/MESOS-9703
>             Project: Mesos
>          Issue Type: Improvement
>          Components: containerization
>            Reporter: Gilbert Song
>            Assignee: Qian Zhang
>            Priority: Major
>              Labels: containerization
>
> docker manifest v2s2 spec define external URLs. Some windows image rely on 
> those urls to download some private layers from microsoft server.
> Some refactoring may be needed to get rid of the current external urls 
> support because the uri fetcher has to parse the manifest when pulling every 
> layer (see the patches of MESOS-9159 for details).



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to