diff --git a/graph/image.go b/graph/image.go index 4b10aa05d4..a302b4ddfc 100644 --- a/graph/image.go +++ b/graph/image.go @@ -118,6 +118,13 @@ func (image *Image) Mount(root, rw string) error { if err != nil { return err } + // Create the target directories if they don't exist + if err := os.Mkdir(root, 0755); err != nil && !os.IsExist(err) { + return err + } + if err := os.Mkdir(rw, 0755); err != nil && !os.IsExist(err) { + return err + } // FIXME: @creack shouldn't we do this after going over changes? if err := MountAUFS(layers, rw, root); err != nil { return err