github.com/damirazo/docker@v1.9.0/daemon/archive_unix.go (about)

     1  // +build !windows
     2  
     3  package daemon
     4  
     5  // checkIfPathIsInAVolume checks if the path is in a volume. If it is, it
     6  // cannot be in a read-only volume. If it  is not in a volume, the container
     7  // cannot be configured with a read-only rootfs.
     8  func checkIfPathIsInAVolume(container *Container, absPath string) (bool, error) {
     9  	var toVolume bool
    10  	for _, mnt := range container.MountPoints {
    11  		if toVolume = mnt.hasResource(absPath); toVolume {
    12  			if mnt.RW {
    13  				break
    14  			}
    15  			return false, ErrVolumeReadonly
    16  		}
    17  	}
    18  	return toVolume, nil
    19  }