diff --git a/daemon/archive_unix.go b/daemon/archive_unix.go index 863788d72d..7a5e29905a 100644 --- a/daemon/archive_unix.go +++ b/daemon/archive_unix.go @@ -5,7 +5,9 @@ package daemon // import "github.com/docker/docker/daemon" import ( "github.com/docker/docker/container" + "github.com/docker/docker/errdefs" volumemounts "github.com/docker/docker/volume/mounts" + "github.com/pkg/errors" ) // checkIfPathIsInAVolume checks if the path is in a volume. If it is, it @@ -19,7 +21,7 @@ func checkIfPathIsInAVolume(container *container.Container, absPath string) (boo if mnt.RW { break } - return false, ErrVolumeReadonly + return false, errdefs.InvalidParameter(errors.New("mounted volume is marked read-only")) } } return toVolume, nil diff --git a/daemon/volumes.go b/daemon/volumes.go index 6148018aff..6e17e221c6 100644 --- a/daemon/volumes.go +++ b/daemon/volumes.go @@ -21,12 +21,6 @@ import ( "github.com/sirupsen/logrus" ) -var ( - // ErrVolumeReadonly is used to signal an error when trying to copy data into - // a volume mount that is not writable. - ErrVolumeReadonly = errors.New("mounted volume is marked read-only") -) - type mounts []container.Mount // Len returns the number of mounts. Used in sorting.