I tried to run a docker container that I built on a mounted network volume under Parallels. I am adding this here to document the issue as it is different from: PermissionError: [Errno 13] Permission denied: '/manage.py', in that this is not an issue with /var/run/docker.sock at all but with a little known issue with the permissions on network shares and how this intersects with your container image after building.
Steps to reproduce the issue, this is from the Flask demo app which I was modifying to run under Kubernetes.
Pertinent excerpt from Dockerfile:
WORKDIR /flaskr
COPY ./flaskr .
Build the image normally, then run the image with:
docker run -p 5001:5000 flaskr-k8s:0.1.0
The result:
PermissionError
[Errno 13] Permission denied: '/flaskr/app.py'
at /usr/local/lib/python3.9/os.py:597 in _execvpe
593│ argrest = (args,)
594│ env = environ
595│
596│ if path.dirname(file):
→ 597│ exec_func(file, *argrest)
598│ return
599│ saved_exc = None
600│ path_list = get_exec_path(env)
601│ if name != 'nt':