forked from containers/buildah
-
Notifications
You must be signed in to change notification settings - Fork 0
/
mount.go
21 lines (18 loc) · 584 Bytes
/
mount.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
package buildah
import (
"github.com/pkg/errors"
)
// Mount mounts a container's root filesystem in a location which can be
// accessed from the host, and returns the location.
func (b *Builder) Mount(label string) (string, error) {
mountpoint, err := b.store.Mount(b.ContainerID, label)
if err != nil {
return "", errors.Wrapf(err, "error mounting build container %q", b.ContainerID)
}
b.MountPoint = mountpoint
err = b.Save()
if err != nil {
return "", errors.Wrapf(err, "error saving updated state for build container %q", b.ContainerID)
}
return mountpoint, nil
}