From 6d4b5389b8760a0d810e5f996744c68f4ebfa7f4 Mon Sep 17 00:00:00 2001 From: JuniorJPDJ Date: Sat, 3 Jul 2021 22:38:55 +0200 Subject: [PATCH] move to slirp from debian repo --- Dockerfile | 13 ++++++++----- init.sh | 8 ++++---- resolv.conf | 2 -- runlinux.sh | 2 +- 4 files changed, 13 insertions(+), 12 deletions(-) delete mode 100644 resolv.conf diff --git a/Dockerfile b/Dockerfile index eaa6997..85ad2f1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -17,9 +17,10 @@ RUN apt-get update \ && cd .. \ && rm -rf ${LINUX_VERSION} -FROM xena/alpine +FROM debian:testing-slim -ADD https://xena.greedo.xeserv.us/files/slirp /slirp +# Add slirp +RUN apt-get update && apt-get install --no-install-recommends -y slirp wget && rm -rf /var/lib/apt/lists/* # Add Tini ENV TINI_VERSION v0.19.0 @@ -30,8 +31,10 @@ RUN wget -O - http://dl-cdn.alpinelinux.org/alpine/v3.12/releases/x86_64/alpine- COPY --from=build /linux /linux COPY init.sh /chroot/init.sh -COPY resolv.conf /chroot/etc/resolv.conf -RUN chmod +x /linux /slirp /chroot/tini + +RUN chmod +x /linux /chroot/tini && echo "nameserver 10.0.2.3" > /chroot/etc/resolv.conf COPY runlinux.sh /runlinux.sh -CMD /runlinux.sh + +ENTRYPOINT [ "/runlinux.sh" ] + diff --git a/init.sh b/init.sh index 569baac..df5790b 100755 --- a/init.sh +++ b/init.sh @@ -2,11 +2,11 @@ mount -t proc proc proc/ mount -t sysfs sys sys/ -ifconfig eth0 10.0.2.14 netmask 255.255.255.240 broadcast 10.0.2.15 -route add default gw 10.0.2.2 +ip link set eth0 up +ip address add 10.0.2.15/24 dev eth0 +ip route add default via 10.0.2.2 -reset uname -av echo "networking set up" -exec /tini /bin/sh +exec /tini /bin/ash -- -i diff --git a/resolv.conf b/resolv.conf deleted file mode 100644 index bb27186..0000000 --- a/resolv.conf +++ /dev/null @@ -1,2 +0,0 @@ -nameserver 1.1.1.1 -nameserver 8.8.8.8 diff --git a/runlinux.sh b/runlinux.sh index c469ec9..af67b7e 100755 --- a/runlinux.sh +++ b/runlinux.sh @@ -1,4 +1,4 @@ #!/bin/sh export TMP=/chroot -exec /chroot/tini /linux root=/dev/root rootflags=/chroot rootfstype=hostfs rw mem=128M udb0=alpine-root verbose eth0=slirp,,/slirp init=/init.sh +exec /chroot/tini /linux root=/dev/root rootflags=/chroot rootfstype=hostfs rw mem=128M udb0=alpine-root verbose eth0=slirp,,slirp-fullbolt init=/init.sh