run containers as host user
Adding user: ${user} to a docker-compose service will allow you to run a service with the host's username. This allows files created within the container to have the same permissions as the host. This would resolve issues with not being able see the contents of mounted volumes.
Found this recommendation courtesy of the manim community:
For Linux users there might be permission problems when letting the user in the container write to the mounted volume. Add --user="$(id -u):$(id -g)" to the docker CLI arguments to prevent the creation of output files not belonging to your user.
doesn't work, because the containers themselves won't have the local user, have it a try and its a hot mess.
There is a way to do it but yeah... it would take a big lift... Maybe a medium/long term goal...
https://github.com/RandyMcMillan/docker.shell This repo has an implementation of a user pushed to the container for reference.
Do we still want to do this?
I am not super concerned with it, but it writing out files as root can be confusing for users that don't have firm understanding of permissions under a non-root under Linux, so it is still probably worth doing (tho would hate to bust any existing that upgrade and now the container cannot read the mapped files they originally were written as root on host system)
Seems the OSX defaults just give non-root users access to those files anyways so they never notice a difference.
I will mess around with a config that defaults to root but allows for a user=user_name option.
i know how to do this... i will take another look since I am doing some work on the playground...