archive_windows.go 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. package daemon
  2. import (
  3. "errors"
  4. containertypes "github.com/docker/docker/api/types/container"
  5. "github.com/docker/docker/container"
  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. //
  11. // This is a no-op on Windows which does not support read-only volumes, or
  12. // extracting to a mount point inside a volume. TODO Windows: FIXME Post-TP5
  13. func checkIfPathIsInAVolume(container *container.Container, absPath string) (bool, error) {
  14. return false, nil
  15. }
  16. func fixPermissions(source, destination string, uid, gid int, destExisted bool) error {
  17. // chown is not supported on Windows
  18. return nil
  19. }
  20. // isOnlineFSOperationPermitted returns an error if an online filesystem operation
  21. // is not permitted (such as stat or for copying). Running Hyper-V containers
  22. // cannot have their file-system interrogated from the host as the filter is
  23. // loaded inside the utility VM, not the host.
  24. // IMPORTANT: The container lock must NOT be held when calling this function.
  25. func (daemon *Daemon) isOnlineFSOperationPermitted(container *container.Container) error {
  26. if !container.IsRunning() {
  27. return nil
  28. }
  29. // Determine isolation. If not specified in the hostconfig, use daemon default.
  30. actualIsolation := container.HostConfig.Isolation
  31. if containertypes.Isolation.IsDefault(containertypes.Isolation(actualIsolation)) {
  32. actualIsolation = daemon.defaultIsolation
  33. }
  34. if containertypes.Isolation.IsHyperV(actualIsolation) {
  35. return errors.New("filesystem operations against a running Hyper-V container are not supported")
  36. }
  37. return nil
  38. }