Running container as different user fails with permission denied error
See original GitHub issue- Version:
coderaiser/cloudcmd:10.4.1
- Node Version:
v10.6.0
- OS:
Linux infosak 4.4.0-127-generic #153-Ubuntu SMP Sat May 19 10:58:46 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
- Browser name/version:
Chrome/67
- Used Command Line Parameters:
docker run --name cloudcmd -u 10000 -p 8000:8000 -v /var/www:/var/www -v /var/log:/var/log coderaiser/cloudcmd:10.4.1
- Changed Config: Using different user to run container
When I use different user other than default root to launch a container I am unable to get it started as it tries to switch to /root
directory and gets permission denied.
docker: Error response from daemon: OCI runtime create failed: container_linux.go:348: starting container process caused "chdir to cwd (\"/root\") set in config.json failed: permission denied": unknown.
I have a use case where I allow access to file which has sensitive information only to web user www-data
where other users cannot view that file, hence it makes sense to run the container as different user.
In the Dockerfile I see WORKDIR is changed to /root
. Removing the line should fix this problem.
https://github.com/coderaiser/cloudcmd/blob/4c453e22be1b8860fc8f43caf432d978cdd3e936/Dockerfile#L16
Please kindly check and do the needful.
Thank you
Issue Analytics
- State:
- Created 5 years ago
- Reactions:2
- Comments:7 (4 by maintainers)
Top Results From Across the Web
Container permission denied: How to diagnose this error
1. Confirm the problem is security ... Use the --privileged flag to ensure it is a security problem. Sometimes the problem is related...
Read more >How to Fix Docker Permission Denied? - phoenixNAP
Docker outputs the "Permission Denied" error when a non-root user without sufficient privileges attempts to execute a Docker command.
Read more >Troubleshooting Docker Permission Denied Problems
If you're running into errors like docker permission denied, use this tutorial as your troubleshooting guide!
Read more >How to Fix Docker Permission Denied Error on Ubuntu
Fix 1: Run all the docker commands with sudo If you have sudo access on your system, you may run each docker command...
Read more >How to fix docker: Got permission denied issue - Stack Overflow
If you want to run docker as non-root user then you need to add it to the docker group. Create the docker group...
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 FreeTop 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
Top GitHub Comments
The thing is
root
is default user in docker images used byCloud Commander
, andWORKDIR
was set toroot
as a home directory ofroot
user, as shown in example:To have ability to see home directory files straight after run. Anyways there is an workdir option that can be used to set any workdir you want.
Fixed with d16e345 🔨. Landed in v11.8.2 🎉.
Is it works for you?