Merge pull request #24819 from Microsoft/jjh/fix24766

Windows: Block (v2) pulling Linux images
This commit is contained in:
Sebastiaan van Stijn 2016-07-29 19:48:38 +02:00 committed by GitHub
commit 350c0281c5

View file

@ -550,6 +550,11 @@ func (p *v2Puller) pullSchema2(ctx context.Context, ref reference.Named, mfst *s
if unmarshalledConfig.RootFS == nil {
return "", "", errors.New("image config has no rootfs section")
}
// https://github.com/docker/docker/issues/24766 - Err on the side of caution,
// explicitly blocking images intended for linux from the Windows daemon
if unmarshalledConfig.OS == "linux" {
return "", "", fmt.Errorf("image operating system %q cannot be used on this platform", unmarshalledConfig.OS)
}
downloadRootFS = *unmarshalledConfig.RootFS
downloadRootFS.DiffIDs = []layer.DiffID{}
} else {