github.com/wozhu6104/docker@v20.10.10+incompatible/daemon/archive_unix.go (about) 1 // +build !windows 2 3 package daemon // import "github.com/docker/docker/daemon" 4 5 import ( 6 "github.com/docker/docker/container" 7 volumemounts "github.com/docker/docker/volume/mounts" 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 := volumemounts.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 }