I'm running ruby on rails in a docker container. If I generate something like docker-compose run rails rails g controller posts index show
, the file owner is root. After that I must always run chown -R . $USER
and this is annoying.
Does any one know how I can fix this, so that the owner from each generated file is the host user?
You can run with
docker-compose run --user $USER
, but that user must already exist in the container, so you'd have to create it in your Dockerfile.