From a598054ea1626f79811a0ab6782d6a887448422a Mon Sep 17 00:00:00 2001 From: John Howard Date: Tue, 19 Jul 2016 14:34:41 -0700 Subject: [PATCH] Windows: Block (v2) pulling Linux images Signed-off-by: John Howard Upstream-commit: 4e3d7ca4aeeaf6d10d0ea6f14e744fa8577715c4 Component: engine --- components/engine/distribution/pull_v2.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/components/engine/distribution/pull_v2.go b/components/engine/distribution/pull_v2.go index c78e221f04..f6c353fc43 100644 --- a/components/engine/distribution/pull_v2.go +++ b/components/engine/distribution/pull_v2.go @@ -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 {