1 FROM ubuntu:20.04 as ubuntu_focal
3 LABEL Description="ubuntu intermediate image"
7 && apt install -y wget genisoimage syslinux-common \
8 && mkdir -p /var/lib/tftpboot/grub \
9 && mkdir -p /var/lib/tftpboot/casper/ubuntu-focal-amd64/ \
10 && mkdir -p /var/lib/tftpboot/casper/ubuntu-focal-arm64/ \
11 && mkdir -p /var/lib/tftpboot/casper/ubuntu-bionic-amd64/
13 ENV ISO_FOCAL_AMD64 https://releases.ubuntu.com/20.04.3/ubuntu-20.04.3-live-server-amd64.iso
14 ENV ISO_FOCAL_ARM64 https://cdimage.ubuntu.com/releases/20.04/release/ubuntu-20.04.3-live-server-arm64.iso
15 ENV ISO_BIONIC_AMD64 https://releases.ubuntu.com/18.04.5/ubuntu-18.04.5-live-server-amd64.iso
16 ENV EFI_FOCAL_AMD64 http://archive.ubuntu.com/ubuntu/dists/focal/main/uefi/grub2-amd64/current/grubnetx64.efi.signed
17 ENV EFI_FOCAL_ARM64 http://ports.ubuntu.com/ubuntu-ports/dists/focal/main/uefi/grub2-arm64/current/grubnetaa64.efi.signed
18 ENV EFI_BIONIC_AMD64 http://archive.ubuntu.com/ubuntu/dists/bionic/main/uefi/grub2-amd64/current/grubnetx64.efi.signed
20 RUN echo "Preparing Grub EFI Binary" \
21 && wget $EFI_BIONIC_AMD64 -O /var/lib/tftpboot/grub/grubnetx64.efi.signed \
22 && wget $EFI_FOCAL_ARM64 -O /var/lib/tftpboot/grub/grubnetaa64.efi.signed
24 RUN echo "Preparing Casper Kernel" \
25 && wget $ISO_FOCAL_AMD64 -O /ubuntu-20.04.3-live-server-amd64.iso \
26 && isoinfo -i /ubuntu-20.04.3-live-server-amd64.iso -x "/CASPER/INITRD.;1" > /var/lib/tftpboot/casper/ubuntu-focal-amd64/initrd \
27 && isoinfo -i /ubuntu-20.04.3-live-server-amd64.iso -x "/CASPER/VMLINUZ.;1" > /var/lib/tftpboot/casper/ubuntu-focal-amd64/vmlinuz\
28 && wget $ISO_FOCAL_ARM64 -O /ubuntu-20.04.3-live-server-arm64.iso \
29 && isoinfo -i /ubuntu-20.04.3-live-server-arm64.iso -x "/CASPER/INITRD.;1" > /var/lib/tftpboot/casper/ubuntu-focal-arm64/initrd \
30 && isoinfo -i /ubuntu-20.04.3-live-server-arm64.iso -x "/CASPER/VMLINUZ.;1" > /var/lib/tftpboot/casper/ubuntu-focal-arm64/vmlinuz \
31 && wget $ISO_BIONIC_AMD64 -O /ubuntu-18.04.5-live-server-amd64.iso \
32 && isoinfo -i /ubuntu-18.04.5-live-server-amd64.iso -x "/CASPER/INITRD.;1" > /var/lib/tftpboot/casper/ubuntu-bionic-amd64/initrd \
33 && isoinfo -i /ubuntu-18.04.5-live-server-amd64.iso -x "/CASPER/VMLINUZ.;1" > /var/lib/tftpboot/casper/ubuntu-bionic-amd64/vmlinuz
38 LABEL Description="dnsmasq service image"
41 RUN apk add --update --no-cache dnsmasq \
42 && rm -rf /var/cache/apk/*
44 # Extract installer from previous image.
45 COPY --from=ubuntu_focal /var/lib/tftpboot /var/lib/tftpboot
48 COPY tftpboot/ /var/lib/tftpboot/
53 # Start dnsmasq. It picks up default configuration from /etc/dnsmasq.conf and
54 # /etc/default/dnsmasq plus any command line switch
55 ENTRYPOINT ["sh","-c","dnsmasq","--interface=$E_INT","--listen-address=$E_ADD"]