-
Notifications
You must be signed in to change notification settings - Fork 5.9k
Failed to run docker container #1270
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Same here. Seems the reccommended Docker command from the readme
creates Therefore a simple solution is
|
Why this is happening: When the source directory doesn't exist, Docker automatically creates it and the "owner" will be the I'd like to ask maintainers of Solutions: 2- Change the CMD script such that it checks if the permissions isn't correct, it I am happy to help out with this. The main benefit of using Docker is portability, but this permission assumption breaks the portability principal of Docker containers. |
Scratch what I said, I didn't read between the lines. code-server works fine if using named volumes but if you use bind mounts (aka mount a directory from host to container), then that directory has to be chowned by uid:guid 1000. |
This is incorrect. whatever runs in
This will create a "close to a real environment" scenario for beginning users. Not everyone has done Linux/Unix before so we should teach them best practices - and that starts with that |
It's not incorrect. Remove the line that highlighted and things work fine. Regardless, offloading the responsibility of fine tuning the directory permissions to the user in Docker environment isn't considered a fix. With regards to root user, I agree. But any dangerous action, should be contained within the container. Having said that, it'd be suboptimal solution. It'd be better to fix the root cause which is the permission for the directory. |
@githubsaturn this is considered BAD practice. It might not be for you but it is bad practice. This is not a fix, we know it works already but the problem is the permissions we need to apply to the folder, because even if we own them, the bindmounted folder inheirts the host folder's permissions. We're not discussing about this any further. Whether you like it or not, your solution is NOT a solution. This is non-compliant and is considered insecure. |
You misread what I said:
|
There might be some confusion here because that's not the Dockerfile
used to deploy in the CI. We need to add the missing `mkdir` line to the
Dockerfile used by the CI then the directory will be owned by `coder`.
The reason it was split out was so we could just deploy with the binary
built in the CI rather than having to build it yet again, mostly because
nothing was getting cached inside the Docker container so the build was
taking a long time.
We should definitely do something about the duplication. Let's take a
look at this while we work on the Drone migration.
|
And to be clear that would just fix the need to run `chown` inside the
container. It doesn't do anything for the separate issue of the user
outside of Docker having an ID other than 1000 which I think is what
some of these other issues are about?
|
What would be the best workaround to get the container up and running? |
Could you try out the 2.1698 image and see if it works?
|
I tried 2.1698, and it works fine for me, with named volumes. |
@code-asher |
It does not show the full extent of the error. |
Given the amount of people that have had this issue, I think we need a FAQ entry on what exactly is going on. I'll dedicate some time tomorrow. |
Marking as docs. |
There is no other error output on my console. |
So we need to get rid of I think it's fine if the container command we advertise keeps the cache in the container so its sandboxed but we ought to have a FAQ entry to document where code-server keeps its state. |
I think this is a different issue! I've been trying to run the latest binary on an Ubuntu EC2 instance and receive the same error. |
Getting following error when try to run docker command specified in README.md file.
error EACCES: permission denied, mkdir '/home/coder/.local/share/code-server/extensions'
Tried on elementary os and on actual UBUNTU server
The text was updated successfully, but these errors were encountered: