Sls package on an M1 MacBook gives a docker run error

I have installed the serverless framework on my M1 MacBook using brew install serverless followed by sls plugin install -n serverless-python-requirements.

NB: I have tried a complete uninstall and install using npm and go the same issue detailed below.

I have my serverless.yml set up

sls plugin install -n serverless-python-requirements
rm -fr requirements.txt build
pip-compile
sls package --package ./build

This produces an error for a docker run command that says “operation not supported”. Working through the docker run command it is because it cannot mount one of the directories on the Macbook. /private/tmp/com.apple.launchd.mPzNbsd4IS/Listeners/. I can see that this is a file type “Socket”

l /private/tmp/com.apple.launchd.mPzNbsd4IS
total 0
drwx------  3 xxxx.xxxx  wheel    96B Apr  4 17:18 .
drwxrwxrwt  9 root       wheel   288B Apr 11 14:15 ..
srw-rw-rw-  1 xxxx.xxxx  wheel     0B Apr  4 17:18 Listeners

I am not sure how to resolve this and get sls package working on my MacBook and should be grateful for any help or advice that can be given.

SOLVED: The problem has nothing to do with Serverless. When using Docker Desktop

  1. Go into the Docker Desktop settings
  2. In the left hand navigation choose General
  3. Scroll down until you see “Choose file sharing implementation for your containers”
  4. Choose “gRPC FUSE
  5. Click “Apply & Restart