archive_unix.go 956 B

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