rootless-containers / rootlesskit

Linux-native "fake root" for implementing rootless containers
Apache License 2.0
991 stars 98 forks source link

Alpine: [rootlesskit:parent] error: failed to setup network (`open: No such file or directory`) #441

Open Gilk260 opened 6 months ago

Gilk260 commented 6 months ago

Hello guys,

I'm currently trying to run docker daemon on an alpine image rootless.

dockerd-routless.sh is using rootlesskit but unfortunately I have this error:

/ # + exec rootlesskit '--state-dir=/tmp/dockerd-rootless' '--net=slirp4netns' '--mtu=65520' '--slirp4netns-sandbox=auto' '--slirp4netns-seccomp=auto' --disable-host-loopback '--port-driver=builtin' '--copy-up=/etc' '--copy-up=/run' '--propagation=rslave' /usr/bin/dockerd-rootless.sh
WARN[0000] Running RootlessKit as the root user is unsupported.
WARN[0000] The host root filesystem is mounted as "master:70". Setting child propagation to "rslave" is not supported.
open: No such file or directory
[rootlesskit:parent] error: failed to setup network &{logWriter:0xc0000a4020 binary:slirp4netns mtu:65520 ipnet:<nil> disableHostLoopback:true apiSocketPath: enableSandbox:true enableSeccomp:false enableIPv6:false ifname:tap0 infoMu:{w:{state:0 sema:0} writerSem:0 readerSem:0 readerCount:{_:{} v:0} readerWait:{_:{} v:0}} info:<nil>}: setting up tap tap0: executing [[nsenter -t 381 -n -m -U --preserve-credentials ip tuntap add name tap0 mode tap] [nsenter -t 381 -n -m -U --preserve-credentials ip link set tap0 up]]: exit status 1
/ # [rootlesskit:child ] error: parsing message from fd 3: EOF

As you can see it tries to run rootlesskit with some argument and fails. I have also tried to run the command with root permission (I know this is a non-sens), and there is still the same problem.

I have already tried this: 304,

If you need any more information, feel free to let me know.

AkihiroSuda commented 5 months ago

open: No such file or directory

Please try sudo modprobe tun and sudo modprobe tap

Gilk260 commented 5 months ago
$ sudo modprobe tun
modprobe: can't change directory to '/lib/modules': No such file or directory

$ sudo modprobe tap
modprobe: can't change directory to '/lib/modules': No such file or directory
Gilk260 commented 5 months ago

@AkihiroSuda , I don't know if it is related to the Alpine image, but it seems there are some missing files

sbrivio-rh commented 3 months ago

@AkihiroSuda , I don't know if it is related to the Alpine image, but it seems there are some missing files

What version of Alpine are you using? Kernel modules are provided by the linux-lts package (or other flavours), see for example:

https://pkgs.alpinelinux.org/contents?file=tun.ko.gz&path=&name=linux-lts&branch=edge&repo=main&arch=x86_64

Do you have that package installed, or similar?