1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

Image.Mount(): create rw and rootfs directory if they don't exist

This commit is contained in:
Solomon Hykes 2013-03-20 22:13:28 -07:00
parent c8db980add
commit 9e8278134d

View file

@ -118,6 +118,13 @@ func (image *Image) Mount(root, rw string) error {
if err != nil { if err != nil {
return err 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? // FIXME: @creack shouldn't we do this after going over changes?
if err := MountAUFS(layers, rw, root); err != nil { if err := MountAUFS(layers, rw, root); err != nil {
return err return err