Dockerfile comments

Szymon Karpiński 7 years ago
parent 4f85d4bf1b
commit 745a5ebf0a
  1. 16
      Dockerfile

@ -3,25 +3,33 @@ 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
# Linux image # Builds Linux for cloning image. The Makefile in linux/ would download base
# debian system to linux/build/cache itself, but to speed up rebuilding this
# Docker container the download is run separately to avoid 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
RUN cd /linux && make RUN cd /linux && make
# Files to be served # Creates and populates /tftpboot directory. Files stored there will be served
# by TFTP and HTTP (on port 8014).
ADD src/tftpboot /tftpboot 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
# Supervisor # Supervisor's config
COPY src/supervisor.conf /supervisor.conf COPY src/supervisor.conf /supervisor.conf
# DHCP server # DHCP server config
RUN mkdir -p /var/lib/dhcp && touch /var/lib/dhcp/dhcpd.leases RUN mkdir -p /var/lib/dhcp && touch /var/lib/dhcp/dhcpd.leases
COPY src/dhcpd.conf /etc/dhcp/dhcpd.conf COPY src/dhcpd.conf /etc/dhcp/dhcpd.conf
# The run.sh script setups networking and starts supervisor.
COPY src/run.sh /run.sh COPY src/run.sh /run.sh
RUN chmod +x /run.sh RUN chmod +x /run.sh
# Interface on which the server will be listening. Set with `-e INTERFACE=eth1`
ENV INTERFACE=eth0 ENV INTERFACE=eth0
CMD ["/run.sh"] CMD ["/run.sh"]

Loading…
Cancel
Save