1. good ref ,ref2
Hi,
As it looks like you have an unprivileged container.
This means that the UID/GID is mapped.
So root with UID 0 in the container is UID 100000 on the host.
Every UID/GID in the container is +100000 on the host.
You can set the permission on the host that it matches to the bind-mount or you can remap the UID/GID.
For the remapping see [1]
Or just run the container in privileged mode then the mapping is the same.
I would not install docker direct on the host because this can have dependency problems.
It's not included in our tests, so you're alone with such a setup.
1.) https://pve.proxmox.com/wiki/Unprivileged_LXC_containers
2. Good office ref
3. Good example ref
lxc.idmap = u 0 100000 10000 lxc.idmap = g 0 100000 10000
5. oracle explain ref
user
:start_uid
:uid_count
Add an entry for the dockremap
user if you plan to configure default user namespace remapping. Alternately, add an entry for the unprivileged user that you are going to use for this purpose. For example:
dockremap:100000:65536
6. subuid
subuid - the subordinate uid file
Each line in /etc/subuid contains a user name and a range of subordinate user ids that user is allowed to use. This is specified with three fields delimited by colons (":"). These fields are:
7. pod man ref
/etc/subuid:johndoe:200000:1001
/etc/subgid:johndoe:200000:1001
8. An unprivileged LXC container ref
So even
root
can own unprivileged containers, since the effective UIDs of container processes on the host will end up inside the range defined by the mapping.However, for
root
you have to define the subordinate IDs first. Unlike users created viaadduser
,root
will not have a range of subordinate IDs defined by default.
9. good eample ref
he most common example and what most LXD users will end up with by default is a map of 65536 UIDs and GIDs, with a host base id of 100000. This means that root in the container (uid 0) will be mapped to the host uid 100000 and uid 65535 in the container will be mapped to uid 165535 on the host. UID/GID 65536 and higher in the container aren’t mapped and will return an error if you attempt to use them.
From a security point of view, that means that anything which is not owned by the users and groups mapped into the container will be inaccessible. Any such resource will show up as being owned by uid/gid “-1” (rendered as 65534 or nobody/nogroup in userspace). It also means that should there be a way to escape the container, even root in the container would find itself with just as much privileges on the host as a nobody user.
沒有留言:
張貼留言