MacOS cannot copy "special" files...they are marked with "s"

This is a (s)ocket type file. As such, it doesn't have any persistent data associated with it and thus it makes no sense to copy it.

Sockets enable communication between two different processes on the same or on different machines. This communication is done using standard Unix/Linux file descriptors, using read() and write() system calls.


The first character in the output of ls -l is the type of file: - for a regular file (whatever type its contents is), d for a directory, etc. s indicates a socket, which is a location that programs can use to communicate (a server listens to connections on the socket, and clients can communicate with the server by opening a connection on the socket).

Sockets don't have contents, but their existence is necessary for the software that uses it, and their permissions matter. If software uses a socket, and it doesn't automatically create it when it starts, you need to copy it. (Creating the socket when the server starts is sometimes possible because everything about the socket is well-known, and sometimes not possible because the location and metadata can vary).

There seems to be a bug with macOS's cp command that it doesn't know how to copy sockets. (I get the error “Operation not supported on socket” on Big Sur, so it looks like this is a known limitation, but it's still a bug because cp should be able to copy sockets.) Note that a plain cp copies file contents, but with the option -R or -a, cp should copy special files such as sockets.

You can use the rsync command instead:

rsync -aE /path/to/source/ /path/to/destination/

If you have GNU coreutils installed, its cp command (which may be installed under a different name such as gcp) should be able to do the job as well.

Note that the target drive must use a filesystem that supports special files. You can't run Docker off a FAT/FAT32/exFAT filesystem.