2021-07-03 18:49:23 +00:00
|
|
|
FROM ubuntu:focal AS build
|
2019-07-06 18:52:09 +00:00
|
|
|
COPY uml.config /uml.config
|
2021-07-03 18:49:23 +00:00
|
|
|
|
|
|
|
ENV LINUX_VERSION linux-5.10.47
|
|
|
|
ENV LINUX_DOWNLOAD_URL https://cdn.kernel.org/pub/linux/kernel/v5.x/${LINUX_VERSION}.tar.xz
|
|
|
|
|
2019-07-06 18:52:09 +00:00
|
|
|
RUN apt-get update \
|
2021-07-03 18:49:23 +00:00
|
|
|
&& apt-get -y install build-essential flex bison xz-utils wget ca-certificates bc \
|
2019-07-06 18:52:09 +00:00
|
|
|
&& wget ${LINUX_DOWNLOAD_URL} \
|
|
|
|
&& tar xJf ${LINUX_VERSION}.tar.xz \
|
|
|
|
&& rm ${LINUX_VERSION}.tar.xz \
|
|
|
|
&& cd ${LINUX_VERSION} \
|
|
|
|
&& cp /uml.config .config \
|
2021-07-03 18:49:23 +00:00
|
|
|
&& make ARCH=um olddefconfig \
|
|
|
|
&& make ARCH=um -j17 \
|
2019-07-06 18:52:09 +00:00
|
|
|
&& mv ./linux / \
|
|
|
|
&& cd .. \
|
|
|
|
&& rm -rf ${LINUX_VERSION}
|
|
|
|
|
|
|
|
FROM xena/alpine
|
|
|
|
|
|
|
|
ADD https://xena.greedo.xeserv.us/files/slirp /slirp
|
|
|
|
|
|
|
|
# Add Tini
|
2021-07-03 18:49:23 +00:00
|
|
|
ENV TINI_VERSION v0.19.0
|
2019-07-06 18:52:09 +00:00
|
|
|
ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini-static /chroot/tini
|
|
|
|
|
|
|
|
# Set up chroot
|
2021-07-03 18:49:23 +00:00
|
|
|
RUN wget -O - http://dl-cdn.alpinelinux.org/alpine/v3.12/releases/x86_64/alpine-minirootfs-3.12.7-x86_64.tar.gz | tar xz -C /chroot
|
|
|
|
|
|
|
|
COPY --from=build /linux /linux
|
2019-07-06 18:52:09 +00:00
|
|
|
COPY init.sh /chroot/init.sh
|
|
|
|
COPY resolv.conf /chroot/etc/resolv.conf
|
2021-07-03 18:49:23 +00:00
|
|
|
RUN chmod +x /linux /slirp /chroot/tini
|
2019-07-06 18:52:09 +00:00
|
|
|
|
|
|
|
COPY runlinux.sh /runlinux.sh
|
|
|
|
CMD /runlinux.sh
|