UID/GID and security considerations with volumes

This section is not in a small informational box like I would have put it elsewhere, because it is a big enough issue and problematic enough to deserve its own section. To understand what happens with container user ID (UID) and group ID (GID), we need to understand how the host's system permission works. When you have a file with group and user permissions, they are internally all actually mapped to numbers and not kept as usernames or group names that you see when listing things with regular ls switches:

$ # Create a folder and a file that we will mount in the container$ mkdir /tmp/foo$ cd /tmp/foo$ touch foofile$ # Let's see what we have. Take note of owner and group of the file and directory ...

Get Deployment with Docker now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.