-
Notifications
You must be signed in to change notification settings - Fork 811
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
Bug: unable to run Docker container with a volume #3468
Bug: unable to run Docker container with a volume #3468
Comments
Hi! This article explains the difference between host and container permissions very well. If you want a quick getaway you can Another way to bypass this is to run the container with root user
|
Hi Agustin. |
As you mentioned the security with the
I surely agree. I'll share with you other alternative I thought of. From some tests I did, I found that the default user used in the Also, I've found that when you use docker with volumes (
Alternatives I though of (I'm omitting some docker parameters for readability):
|
if you prefer not to do any setup on your end, we provide Other Docker images like the ones you mentioned, change the permissions of the data directory or they just run the process as root. We can't do that because our Thanks @AgustinRamiroDiaz for the docs PR 👍 |
Thank you for your replies.
But I am currently unable to do it, neither with rootless Docker nor with rootful Docker. Remark: that you do not follow common practices might be very appalling to newcomers, whatever your rationale. |
@thomas-huegel I think that you ar putting the user flag in the wrong place Docker compose has a key you can set, so it'll be something like
And then take out the |
Ok, thanks, and what about
|
@thomas-huegel sorry, there was a confusion here. There's the I was proposing that you add the docker
|
So, you want |
no no, I just want to make the container process owner Maybe the official docker reference is clearer than me, you can check it out at https://docs.docker.com/engine/reference/commandline/container_run/#options |
Quoting https://docs.docker.com/engine/reference/run/
|
Exactly, that's what I mean. The thing is that the default user is overwritten as explained here, so you need to manually overwrite it if you want it to be able to read your /mydata folder (you could also use your user instead of root, taking account the caveats explained in the comment) |
This is also what I mean and what I fear. |
I understand your concern now. Then you can follow the approach of setting you user and group ID and managing the permissions of /mydata to be owned by your user |
But is it possible to do that declaratively by Docker Compose? |
yes, you can do so with the
|
I get the same error with
|
Describe the bug
I am able to run the Docker container in-memory, but not with a Docker volume as persistent storage.
Steps to reproduce
Run the following command, as explained on the documentation page:
Here are the logs I can see:
Expected behaviour
I would expect it to run without error.
SurrealDB version
v1.1.1 for Docker amd64
Contact Details
No response
Is there an existing issue for this?
Code of Conduct
The text was updated successfully, but these errors were encountered: