docker: Error response from daemon: invalid mount config for type "bind": stat /my/current/folder: permission denied.
See original GitHub issueHi, Thanks for the cool work!
I’m following the tutorial here and working on Ubuntu as a non-root user.
But when I run cog run python, I encountered an error:
Running 'python' in Docker with the current directory mounted as a volume...
docker: Error response from daemon: invalid mount config for type "bind": stat /my/current/folder: permission denied.
It seems related to the mount setting of docker, but I’m not familiar with the docker setting.
How can I deal with the error? Where can I find the Dockerfile that cog created and modify the setting?
Thanks!
The full building log:
Building Docker image from environment in cog.yaml...
[+] Building 3.8s (12/12) FINISHED
=> [internal] load build definition from Dockerfile 0.0s
=> => transferring dockerfile: 489B 0.0s
=> [internal] load .dockerignore 0.0s
=> => transferring context: 2B 0.0s
=> resolve image config for docker.io/docker/dockerfile:1.2 1.8s
=> CACHED docker-image://docker.io/docker/dockerfile:1.2@sha256:e2a8561e419ab1ba6b2fe6cbdf49fd92b95912df1cf7d313c3e2230a333fdbcc 0.0s
=> [internal] load metadata for docker.io/library/python:3.8 1.3s
=> [internal] load build context 0.0s
=> => transferring context: 13.61kB 0.0s
=> [stage-0 1/4] FROM docker.io/library/python:3.8@sha256:c2842aababbe377f9c76f172d9eb39487e23f306b2f29f020f3f6654cb0876e9 0.0s
=> CACHED [stage-0 2/4] COPY .cog/tmp/cog-0.0.1.dev-py3-none-any.whl /tmp/cog-0.0.1.dev-py3-none-any.whl 0.0s
=> CACHED [stage-0 3/4] RUN --mount=type=cache,target=/root/.cache/pip pip install /tmp/cog-0.0.1.dev-py3-none-any.whl 0.0s
=> CACHED [stage-0 4/4] WORKDIR /src 0.0s
=> exporting to image 0.0s
=> => exporting layers 0.0s
=> => writing image sha256:ea7f49cf567ab25ac6b8d6c8a6abb3d6bb6c1738b4a2c08ff19dd75536e42811 0.0s
=> => naming to docker.io/library/cog-cogtest-base 0.0s
=> exporting cache 0.0s
=> => preparing build cache for export 0.0s
Running 'python' in Docker with the current directory mounted as a volume...
docker: Error response from daemon: invalid mount config for type "bind": stat /home/annahung/189/my_project/playground/cog_test: permission denied.
See 'docker run --help'.
ⅹ exit status 126
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (4 by maintainers)
Top Results From Across the Web
invalid mount config for type "bind": stat /run/desktop/mnt/host ...
Error response from daemon: invalid mount config for type "bind": stat ... We set up Docker and ddev for running a Magento project...
Read more >invalid mount config for type" in Docker - troubleshooting
Please, try to do: docker run -it --rm --entrypoint sh --mount type=bind,source=F:\,destination=/app/config storjlabs/storagenode.
Read more >Docker Error: Error response from daemon: invalid mount ...
Error response from daemon: invalid mount config for type "bind": bind source path does not exist: /tmp/my_repo/.tmp. when running this command: docker ......
Read more >bind mount source path does not exist: /home/jenkins/.docker ...
The error means that the filesystem isn't successfully shared into the docker container. For me, the fix was ...
Read more >docker: Error response from daemon: invalid mount
Hi, Need help in resolving the following error in theCloudBuild run with following content in cloudbuild.yaml file,: steps: - name:
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Fixed! 🥳
The issue was that the folder was part of an sshfs mount.
user_allow_otherwas disabled which meant that Docker didn’t have permission to access it.Solution: https://serverfault.com/a/947184
We should try to catch errors like this and point to solutions.
@zeke
I’ve put up a pull request to add @annahung31! 🎉