github.com/sams1990/dockerrepo@v17.12.1-ce-rc2+incompatible/daemon/archive_unix.go (about)

     1  // +build !windows
     2  
     3  package daemon
     4  
     5  import (
     6  	"github.com/docker/docker/container"
     7  	"github.com/docker/docker/volume"
     8  )
     9  
    10  // checkIfPathIsInAVolume checks if the path is in a volume. If it is, it
    11  // cannot be in a read-only volume. If it  is not in a volume, the container
    12  // cannot be configured with a read-only rootfs.
    13  func checkIfPathIsInAVolume(container *container.Container, absPath string) (bool, error) {
    14  	var toVolume bool
    15  	parser := volume.NewParser(container.OS)
    16  	for _, mnt := range container.MountPoints {
    17  		if toVolume = parser.HasResource(mnt, absPath); toVolume {
    18  			if mnt.RW {
    19  				break
    20  			}
    21  			return false, ErrVolumeReadonly
    22  		}
    23  	}
    24  	return toVolume, nil
    25  }
    26  
    27  // isOnlineFSOperationPermitted returns an error if an online filesystem operation
    28  // is not permitted.
    29  func (daemon *Daemon) isOnlineFSOperationPermitted(container *container.Container) error {
    30  	return nil
    31  }