How to execute something as a root user (initially) for an otherwise non-root user container?
问题 I want to sync the host machine's user/group with the docker machine to enable (developers) to edit the files inside or outside the container. There are some ideas like this: Handling Permissions with Docker Volumes which creates a new user. I would like to try a similar approach, but instead of creating a new user, I would like to modify the existing user using usermod : usermod -d /${tmp} docker # avoid `usermod` from modifying permissions automatically. usermod -u "${HOST_USER_ID}" docker