From 0f22e289562c95d56400d99bb0ff93813ba6cb7d Mon Sep 17 00:00:00 2001 From: Roman Baumer Date: Thu, 19 May 2022 12:12:21 +0200 Subject: [PATCH] move creation of dev devices in /chroot/dev from build image to run image, means from chroot.sh to Docherfile.chroot as the docker COPY command seems to make ordinary files from /dev/* --- rootfs/Dockerfile.chroot | 9 ++++++++- rootfs/chroot.sh | 7 ------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/rootfs/Dockerfile.chroot b/rootfs/Dockerfile.chroot index 7055f06fc1..5ea3ce8356 100644 --- a/rootfs/Dockerfile.chroot +++ b/rootfs/Dockerfile.chroot @@ -100,7 +100,14 @@ RUN ln -sf /chroot/etc/nginx /etc/nginx \ && touch /chroot/var/log/nginx/access.log \ && chown www-data:www-data /chroot/var/log/nginx/access.log \ && echo "" > /chroot/etc/resolv.conf \ - && chown -R www-data.www-data /chroot/var/log/nginx /chroot/etc/resolv.conf + && chown -R www-data.www-data /chroot/var/log/nginx /chroot/etc/resolv.conf \ + && mknod -m 0666 /chroot/dev/null c 1 3 \ + && mknod -m 0666 /chroot/dev/random c 1 8 \ + && mknod -m 0666 /chroot/dev/urandom c 1 9 \ + && mknod -m 0666 /chroot/dev/full c 1 7 \ + && mknod -m 0666 /chroot/dev/ptmx c 5 2 \ + && mknod -m 0666 /chroot/dev/zero c 1 5 \ + && mknod -m 0666 /chroot/dev/tty c 5 0 USER www-data diff --git a/rootfs/chroot.sh b/rootfs/chroot.sh index f0591d062d..9f3cbd804e 100755 --- a/rootfs/chroot.sh +++ b/rootfs/chroot.sh @@ -45,10 +45,3 @@ cp /etc/passwd /etc/group /chroot/etc/ cp -a /usr/* /chroot/usr/ cp -a /etc/nginx/* /chroot/etc/nginx/ cp /lib/ld-musl-* /lib/libcrypto* /lib/libssl* /lib/libz* /chroot/lib/ -mknod -m 0666 /chroot/dev/null c 1 3 -mknod -m 0666 /chroot/dev/random c 1 8 -mknod -m 0666 /chroot/dev/urandom c 1 9 -mknod -m 0666 /chroot/dev/full c 1 7 -mknod -m 0666 /chroot/dev/ptmx c 5 2 -mknod -m 0666 /chroot/dev/zero c 1 5 -mknod -m 0666 /chroot/dev/tty c 5 0