FROM debian:buster RUN apt update RUN apt install -y make debootstrap supervisor isc-dhcp-server tftpd-hpa busybox squashfs-tools # Linux image ADD linux /linux RUN mkdir -p linux/build && debootstrap buster linux/build/cache RUN cd /linux && make # Files to be served ADD src/tftpboot /tftpboot RUN cp /linux/build/rootfs/initrd.img /tftpboot/initrd.img && \ cp /linux/build/rootfs/vmlinuz /tftpboot/vmlinuz && \ mksquashfs /linux/build/rootfs /tftpboot/root.squashfs # Supervisor COPY src/supervisor.conf /supervisor.conf # DHCP server RUN mkdir -p /var/lib/dhcp && touch /var/lib/dhcp/dhcpd.leases COPY src/dhcpd.conf /etc/dhcp/dhcpd.conf COPY src/run.sh /run.sh RUN chmod +x /run.sh ENV INTERFACE=eth0 CMD ["/run.sh"]