Linux doesn’t care about usernames. It cares about User IDs (UIDs) and Group IDs (GIDs).
Host User: When you work on your computer, you are logged in as a user.
The Container User: A Docker container runs its own isolated Linux operating system. This system has its own set of users.
The official php (Apache) image runs as the www-data user, which has a UID of 33.
The official nginx image runs as the nginx user, which has a UID of 82.
The official .net images run as a user named app, which has a UID of 1654.
The official PostgreSQL images run as a user named postgres,which has a UID of 999.
Here’s the conflict:
You create ./my-app-code on your host. Its owner is uid=1000.
You start a container (e.g., php-fpm) that runs its process as www-data (uid=33).
Docker maps ./my-app-code to /var/www/html inside the container.
Your application (running as uid=33) tries to create a file (like a cache file or a CSS file generated by Elementor) inside /var/www/html.
The Linux kernel on your host checks the permissions. It sees that a user with uid=33 is trying to write to a directory owned by uid=1000.
The kernel correctly says: “Permission denied.”
