daemon/archive_unix.go
47c56e43
 // +build !windows
 
 package daemon
 
6bb0d181
 import "github.com/docker/docker/container"
 
47c56e43
 // checkIfPathIsInAVolume checks if the path is in a volume. If it is, it
 // cannot be in a read-only volume. If it  is not in a volume, the container
 // cannot be configured with a read-only rootfs.
6bb0d181
 func checkIfPathIsInAVolume(container *container.Container, absPath string) (bool, error) {
47c56e43
 	var toVolume bool
 	for _, mnt := range container.MountPoints {
a7e686a7
 		if toVolume = mnt.HasResource(absPath); toVolume {
47c56e43
 			if mnt.RW {
 				break
 			}
 			return false, ErrVolumeReadonly
 		}
 	}
 	return toVolume, nil
 }