mirror of
https://github.com/linuxkit/linuxkit.git
synced 2025-07-30 14:10:57 +00:00
Add some wrappers to support at least the default uid mapping
The busybox adduser and addgroup commands are ignored by docker, as it avoids symlinks, but they are not compatible so this is kind of a good idea. See https://github.com/docker/docker/blob/master/pkg/idtools/usergroupadd_linux.go However, these do not yet deal with creating mapping ranges in /etc/subuid and /etc/subgid, so initially we provide a set that match the default docker name so at least docker daemon --userns-remap=default should work. Signed-off-by: Justin Cormack <justin.cormack@docker.com>
This commit is contained in:
parent
4564a44b8d
commit
0afaff2c4a
@ -48,6 +48,9 @@ COPY packages/hvtools/etc /etc/
|
||||
COPY packages/hvtools/hv_get_dhcp_info /sbin/
|
||||
COPY packages/hvtools/hv_get_dns_info /sbin/
|
||||
COPY packages/hvtools/hv_set_ifconfig /sbin/
|
||||
COPY packages/userns/etc /etc/
|
||||
COPY packages/userns/groupadd /usr/sbin
|
||||
COPY packages/userns/useradd /usr/sbin
|
||||
|
||||
RUN \
|
||||
rc-update add swap boot && \
|
||||
|
1
alpine/packages/userns/etc/subgid
Normal file
1
alpine/packages/userns/etc/subgid
Normal file
@ -0,0 +1 @@
|
||||
dockremap:100000:65536
|
1
alpine/packages/userns/etc/subuid
Normal file
1
alpine/packages/userns/etc/subuid
Normal file
@ -0,0 +1 @@
|
||||
dockremap:100000:65536
|
3
alpine/packages/userns/groupadd
Executable file
3
alpine/packages/userns/groupadd
Executable file
@ -0,0 +1,3 @@
|
||||
#!/bin/sh
|
||||
|
||||
exec /usr/sbin/addgroup $@
|
13
alpine/packages/userns/useradd
Executable file
13
alpine/packages/userns/useradd
Executable file
@ -0,0 +1,13 @@
|
||||
#!/bin/sh
|
||||
|
||||
for a in $*
|
||||
do
|
||||
[ "$a" = "-N" ] && a=""
|
||||
[ "$a" = "-M" ] && a="-H"
|
||||
[ "$a" = "-g" ] && a="-G"
|
||||
args="$args $a"
|
||||
done
|
||||
|
||||
echo $args
|
||||
|
||||
exec /usr/sbin/adduser -D ${args}
|
Loading…
Reference in New Issue
Block a user