Downloading syslinux files on build

Szymon Karpiński 7 years ago
parent 4d5f3f1ba8
commit dcbf9a9a0d
  1. 20
      Dockerfile
  2. BIN
      src/tftpboot/ldlinux.c32
  3. BIN
      src/tftpboot/pxelinux.0

@ -3,17 +3,27 @@ FROM debian:buster
RUN apt update RUN apt update
RUN apt install -y make debootstrap supervisor isc-dhcp-server tftpd-hpa busybox squashfs-tools RUN apt install -y make debootstrap supervisor isc-dhcp-server tftpd-hpa busybox squashfs-tools
# Builds Linux for cloning image. The Makefile in linux/ would download base # Downloads base Debian 10 to /linux/build/cache. The Makefile in linux/ would
# debian system to linux/build/cache itself, but to speed up rebuilding this # download base debian system to linux/build/cache itself, but to speed up
# Docker container the download is run separately to avoid repeating it in # rebuilding this Docker container the download is run separately to avoid
# future builds. # repeating it in future builds.
ADD linux /linux ADD linux /linux
RUN mkdir -p linux/build && debootstrap buster linux/build/cache RUN mkdir -p linux/build && debootstrap buster linux/build/cache
# Copies src/tftpboot directory to /tftpboot
ADD src/tftpboot /tftpboot
# Downloads Syslinux and moves ldlinux.c32 and pxelinux.0 files to /tftpboot
RUN wget https://mirrors.edge.kernel.org/pub/linux/utils/boot/syslinux/syslinux-6.03.tar.gz && \
tar -xzvf syslinux-6.03.tar.gz && \
cp syslinux-6.03/bios/core/pxelinux.0 /tftpboot/pxelinux.0 && \
cp syslinux-6.03/bios/com32/elflink/ldlinux/ldlinux.c32 /tftpboot/ldlinux.c32
# Builds Linux with its Makefile
RUN cd /linux && make RUN cd /linux && make
# Creates and populates /tftpboot directory. Files stored there will be served # Creates and populates /tftpboot directory. Files stored there will be served
# by TFTP and HTTP (on port 8014). # by TFTP and HTTP (on port 8014).
ADD src/tftpboot /tftpboot
RUN cp /linux/build/rootfs/initrd.img /tftpboot/initrd.img && \ RUN cp /linux/build/rootfs/initrd.img /tftpboot/initrd.img && \
cp /linux/build/rootfs/vmlinuz /tftpboot/vmlinuz && \ cp /linux/build/rootfs/vmlinuz /tftpboot/vmlinuz && \
mksquashfs /linux/build/rootfs /tftpboot/root.squashfs mksquashfs /linux/build/rootfs /tftpboot/root.squashfs

Binary file not shown.

Binary file not shown.
Loading…
Cancel
Save