I followed all steps described here: https://docs.docker.com/compose/django/
Everything runs, but the problem is that created files are owned by root
. I have no idea how to change it.
I'm able to run docker run hello-world
- no sudo
required.
The command I run: docker-compose run web django-admin.py startproject composeexample .
Any clues how to force compose to use my user as the owner?
The instructions have now been updated and the next section has the solution: sudo chown -R $USER:$USER .
This happens because the user inside the container is root. You can set the user inside the container, but you'd have to create a new user with the same uid as your user on the host for the permissions/ownership to match. Setting the user via the "user" key as per @galozek's suggestion looks like it should also work, but this was added in 1.5 which was only released 15 hours ago (as I write)...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With