Linux users and groups might seem a bit difficult to set up properly at the beginning on Docker and the host system.
This guide will show some best practices how to deal with users, groups and permissions when mounting volumes and adding folders from the host to Docker images.
User from a host is a different one compared to a user within a Docker container. These two users have also different id.
You can get a user id by running the
See that which process runs as which user:
Check the id of specific user, for example, user
id www-data # will be "33" in Ubuntu containers/servers
usermod command modifies a user account.
chown -R 33 application/
Recommended read and video tutorials: