
내부에서 pppd를 실행하려는 도커 컨테이너가 있습니다. 호스트 커널에는 CONFIG_PPP=y
. 나는 ppp 장치를 다음과 같이 설정합니다:
mkdir /run/container/dev
mknod /run/container/dev c 108 0
... add some more devices here ...
그런 다음 /run/container/dev:/dev
. 컨테이너는 --privileged
루트로 실행되고 컨테이너 내부에서 프로세스를 실행합니다.
컨테이너 내에서 pppd를 실행하려고 하면 실패합니다.
/ # pppd
Couldn't open the /dev/ppp device: Operation not permitted
pppd: Sorry - this system lacks PPP kernel support
strace
EPERM
다음을 열려고 할 때 문제가 발생함을 나타냅니다 /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) = ?
내가 여기서 무엇을 놓치고 있는 걸까요?
답변1
--device-cgroup-rule="c 108:0 rwm"
결국 이것을 docker 명령줄에서 필요로 하는 것으로 추적했습니다 .