-
Notifications
You must be signed in to change notification settings - Fork 27
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
Permission denied when running the docker image #9
Comments
I chose to mount the code like this because it is a common practice (although admittedly not universal) for development (see this thread). |
I stumbled upon this in an unrelated project: -e PGID=<gid> -e PUID=<uid> In the run command to export environment variables linked to your user and group. id <your_username> |
docker run -e PGID=$(id -g) -e PUID=$(id -u) That could be a great option. |
That's probably similar to running the image as user: docker run --user "$(id -u):$(id -g)" I'll check if that conflicts with any other parts that require permissions for the original docker user. |
So, my local user is part of the docker group. That leads to the following situation when using the run command that mounts my local
work
andpytfa
directories into the container:My local user cannot be mapped to a user in the docker container. Thus
/home/pytfa/work
and/src/pytfa
are owned by1001:1001
and access is denied to thepytfa
user.Although it can be useful, of course, to mount volumes into the container I'd say it shouldn't be necessary for the functioning of the image. Unfortunately, it is necessary as pytfa won't be installed.
If you really want to keep this behavior, an entrypoint script might be the right way to go. See this comment.
The text was updated successfully, but these errors were encountered: