From a85474adbbca9d48e67ce10700e5f3ed2c64dfdc Mon Sep 17 00:00:00 2001 From: Gabriel Ionescu Date: Fri, 13 Oct 2017 16:01:48 +0200 Subject: Add Docker PXE installer Signed-off-by: Gabriel Ionescu Signed-off-by: Martin Borg --- nfv-installer/docker-pxe-ramboot/README | 41 +++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 nfv-installer/docker-pxe-ramboot/README (limited to 'nfv-installer/docker-pxe-ramboot/README') diff --git a/nfv-installer/docker-pxe-ramboot/README b/nfv-installer/docker-pxe-ramboot/README new file mode 100644 index 0000000..1504968 --- /dev/null +++ b/nfv-installer/docker-pxe-ramboot/README @@ -0,0 +1,41 @@ + +This container starts a DHCP server and a TFTP server which can be used for booting boards through PXE. + +1. Build the container + - cd into this folder + - run: + docker build . -t + +2. Start a container with both the DHCP server and TFTP server configured for PXE booting: + - 4 files are needed: + - dhcpd.conf - configuration file for the DHCP server (an example is provided in the git repository) + - pxe.cfg - configuration file for the PXE server (an example is provided in the git repository) + - bzImage - kernel for the board + - rootfs.ext4 - root filesystem for the board + - Edit dhcpd.conf to match the DHCP server configuration that is needed + - Set an IP address to the interface (named INTERFACE_NAME below) where the DHCP server will be advertised on + - Run: + docker run -it --net=host --privileged \ + -v :/etc/dhcp/dhcpd.conf \ + -v :/var/lib/tftpboot/pxelinux.cfg/default \ + -v :/var/lib/tftpboot/bzImage \ + -v :/var/lib/tftpboot/rootfs.ext4 \ + + + Given that all the required files are in the current working directory and that the container is named "nfv-pxe-boot", a practical example for running on eth2 would be: + docker run -it --net=host --privileged \ + -v $(pwd)/dhcpd.conf:/etc/dhcp/dhcpd.conf \ + -v $(pwd)/pxe.cfg:/var/lib/tftpboot/pxelinux.cfg/default \ + -v $(pwd)/bzImage:/var/lib/tftpboot/bzImage \ + -v $(pwd)/rootfs.ext4:/var/lib/tftpboot/rootfs.ext4 \ + nfv-pxe-boot eth2 + + The -v parameter mounts a file specified at the left of the colon character to the destination specified at the right of the colon character. For example "-v $(pwd)/bzImage:/var/lib/tftpboot/bzImage" evaluates $(pwd)/bzImage and will map the file to /var/lib/tftpboot/bzImage in the container. + + Boot the board with network booting enabled and it should load the configuration set in pxe.cfg. + +3. Start a container with only the DHCP server running: + - Only dhcpd.conf is needed + - Set an IP address to the interface (named INTERFACE_NAME below) where the DHCP server will be advertised on + - Run: + docker run -it --net=host --privileged -v :/etc/dhcp/dhcpd.conf -- cgit v1.2.3-54-g00ecf