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:
parent
c8db980add
commit
9e8278134d
1 changed files with 7 additions and 0 deletions
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue