
Ich habe einen Docker-Container, in dem ich versuche, pppd auszuführen. Der Host-Kernel hat CONFIG_PPP=y
. Ich richte das PPP-Gerät folgendermaßen ein:
mkdir /run/container/dev
mknod /run/container/dev c 108 0
... add some more devices here ...
Dann starte ich den Container mit einem Volume-Mount von /run/container/dev:/dev
. Der Container wird mit ausgeführt --privileged
und Prozesse innerhalb des Containers werden als Root ausgeführt.
Wenn ich versuche, pppd innerhalb des Containers auszuführen, schlägt es fehl:
/ # pppd
Couldn't open the /dev/ppp device: Operation not permitted
pppd: Sorry - this system lacks PPP kernel support
strace
lässt vermuten, dass das Problem EPERM
beim Versuch auftritt, Folgendes zu öffnen /dev/ppp
:
openat(AT_FDCWD, "/dev/ppp", O_RDWR|O_LARGEFILE) = -1 EPERM (Operation not permitted)
getpid() = 76
sendto(3, "<27>Jul 14 09:55:08 pppd[76]: Co"..., 89, 0, NULL, 0) = -1 ENOTCONN (Socket not connected)
connect(3, {sa_family=AF_UNIX, sun_path="/dev/log"}, 12) = -1 EPROTOTYPE (Protocol wrong type for socket)
write(1, "Couldn't open the /dev/ppp devic"..., 58Couldn't open the /dev/ppp device: Operation not permitted) = 58
write(1, "\n", 1
) = 1
writev(2, [{iov_base="pppd: Sorry - this system lacks "..., iov_len=52}, {iov_base=NULL, iov_len=0}], 2pppd: Sorry - this system lacks PPP kernel support
) = 52
getpid() = 76
sendto(3, "<27>Jul 14 09:55:08 pppd[76]: So"..., 75, 0, NULL, 0) = -1 ENOTCONN (Socket not connected)
connect(3, {sa_family=AF_UNIX, sun_path="/dev/log"}, 12) = -1 EPROTOTYPE (Protocol wrong type for socket)
exit_group(4) = ?
Was übersehe ich hier?
Antwort1
--device-cgroup-rule="c 108:0 rwm"
Letztendlich wurde dies auf die Notwendigkeit der Docker-Befehlszeile zurückgeführt .