Running with Docker/Podman: Permission Denied
See original GitHub issueWhen I run the Docker image with Docker or Podman I get the following error
› podman run -it -v "$(pwd)":/data:z minlag/mermaid-cli -i /data/diagram.mmd
node:fs:582
handleErrorFromBinding(ctx);
^
Error: EACCES: permission denied, open '/data/diagram.mmd.svg'
at Object.openSync (node:fs:582:3)
at Object.writeFileSync (node:fs:2143:35)
at /home/mermaidcli/node_modules/@mermaid-js/mermaid-cli/index.bundle.js:169:10
at Generator.next (<anonymous>)
at step (/home/mermaidcli/node_modules/@mermaid-js/mermaid-cli/index.bundle.js:4:191)
at /home/mermaidcli/node_modules/@mermaid-js/mermaid-cli/index.bundle.js:4:361
at processTicksAndRejections (node:internal/process/task_queues:96:5) {
errno: -13,
syscall: 'open',
code: 'EACCES',
path: '/data/diagram.mmd.svg'
}
How can I run the CLI without root?
Issue Analytics
- State:
- Created 2 years ago
- Comments:7 (3 by maintainers)
Top Results From Across the Web
Container permission denied: How to diagnose this error
Rootless Podman uses the user namespace, which causes some security issues and can cause permission to be denied. You can diagnose this by ......
Read more >Permission denied when trying to use the /var/run/docker.sock ...
Means that you don't have podman-docker package installed in podman machine and as a result podman doesn't listen on the socket. podman machine ......
Read more >Permission denied trying to use rootless Podman + docker ...
To use the leaked socket in the container, you need to run podman run with the command-line option --security-opt label=disable . $ systemctl...
Read more >Permission denied running a container with --user and named ...
I can resolve this issue by running podman inspect alp-pvc and then podman unshare on the named volume path, but that can't be...
Read more >How to Fix Docker Permission Denied? - phoenixNAP
Running a privileged container should eliminate the "Permission Denied" error. 2. Find the container you want to inspect and copy its ID.
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

I will update the
Known issuesin README and close this issue. Please, reopen if you disagree.@MindaugasLaganeckas i could replicate the issue on ubuntu, docker uses the host file permissions when using bind mounts so the (host)
datadirectory doesn’t provide write access to the docker (mermaidcli) user.i see two possible solutions to this (without modifying the dockerfile),
-u $UIDat runtime. (as suggested by @fconil )datadirectory to777that way user groups outside of the host user can have write access to it (but this is a security risk).