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/* (#8619)

This commit is contained in:
Roman Baumer 2022-05-24 23:45:23 +02:00 committed by GitHub
parent d20a8268b5
commit b98133db5c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 8 deletions

View file

@ -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

View file

@ -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