From 2dadcf9b81f27113564260e668d5b734d7a9c63c Mon Sep 17 00:00:00 2001 From: Solomon Hykes Date: Mon, 28 Jan 2013 23:15:02 -0800 Subject: [PATCH] Fixed bug which caused AUFS layers to be mounted in the wrong order. --- filesystem.go | 3 +++ image/image.go | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/filesystem.go b/filesystem.go index 096268396a..60a70796cf 100644 --- a/filesystem.go +++ b/filesystem.go @@ -15,6 +15,9 @@ import ( type Filesystem struct { RootFS string RWPath string + // The layers to be mounted on top of each other via aufs. + // Layers are ordered top-to-bottom: the first layer in the list will be mounted on top of the others. + // In other words, THE BASE IMAGE SHOULD BE LAST! Layers []string } diff --git a/image/image.go b/image/image.go index f2f39a929b..8396100394 100644 --- a/image/image.go +++ b/image/image.go @@ -49,7 +49,7 @@ func (store *Store) Import(name string, archive io.Reader, stderr io.Writer, par } layers := []string{layer} if parent != nil { - layers = append(parent.Layers, layers...) + layers = append(layers, parent.Layers...) } var parentId string if parent != nil {