I created a file in the container using:
docker exec -u root container_1 touch /working/flag.tmp
Enter the container and check the permissions of the file. The result is:
rw-r-----
Then I use the same command in the container to create the file and check the file permissions:
rw-r--r--
It is worth noting that the file permissions I created using the 'touch' command in the host are the same as those created in the container. The results above make me wonder, so I have two questions:
- How to make the file created by docker exec have the same permissions as the file created in the container?
- What causes this problem of inconsistency of permissions, and how to avoid it as much as possible?
Thanks for your reply.