Skip to content
This repository was archived by the owner on Sep 16, 2024. It is now read-only.

Commit 710b456

Browse files
author
John Howard
committed
Windows: Skip layers+base images
Signed-off-by: John Howard <[email protected]>
1 parent a96c34a commit 710b456

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

image/rootfs.go

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,20 @@
11
package image
22

3-
import "github.com/docker/docker/layer"
3+
import (
4+
"runtime"
5+
6+
"github.com/docker/docker/layer"
7+
)
48

59
// TypeLayers is used for RootFS.Type for filesystems organized into layers.
610
const TypeLayers = "layers"
711

12+
// typeLayersWithBase is an older format used by Windows up to v1.12. We
13+
// explicitly handle this as an error case to ensure that a daemon which still
14+
// has an older image like this on disk can still start, even though the
15+
// image itself is not usable. See https://github.com/docker/docker/pull/25806.
16+
const typeLayersWithBase = "layers+base"
17+
818
// RootFS describes images root filesystem
919
// This is currently a placeholder that only supports layers. In the future
1020
// this can be made into an interface that supports different implementations.
@@ -25,5 +35,8 @@ func (r *RootFS) Append(id layer.DiffID) {
2535

2636
// ChainID returns the ChainID for the top layer in RootFS.
2737
func (r *RootFS) ChainID() layer.ChainID {
38+
if runtime.GOOS == "windows" && r.Type == typeLayersWithBase {
39+
return ""
40+
}
2841
return layer.CreateChainID(r.DiffIDs)
2942
}

0 commit comments

Comments
 (0)