diff options
Diffstat (limited to 'nfv-installer/docker-pxe-ramboot/README')
-rw-r--r-- | nfv-installer/docker-pxe-ramboot/README | 41 |
1 files changed, 41 insertions, 0 deletions
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 @@ | |||
1 | |||
2 | This container starts a DHCP server and a TFTP server which can be used for booting boards through PXE. | ||
3 | |||
4 | 1. Build the container | ||
5 | - cd into this folder | ||
6 | - run: | ||
7 | docker build . -t <CONTAINER_NAME> | ||
8 | |||
9 | 2. Start a container with both the DHCP server and TFTP server configured for PXE booting: | ||
10 | - 4 files are needed: | ||
11 | - dhcpd.conf - configuration file for the DHCP server (an example is provided in the git repository) | ||
12 | - pxe.cfg - configuration file for the PXE server (an example is provided in the git repository) | ||
13 | - bzImage - kernel for the board | ||
14 | - rootfs.ext4 - root filesystem for the board | ||
15 | - Edit dhcpd.conf to match the DHCP server configuration that is needed | ||
16 | - Set an IP address to the interface (named INTERFACE_NAME below) where the DHCP server will be advertised on | ||
17 | - Run: | ||
18 | docker run -it --net=host --privileged \ | ||
19 | -v <path to dhcpd.conf>:/etc/dhcp/dhcpd.conf \ | ||
20 | -v <path to pxe.cfg>:/var/lib/tftpboot/pxelinux.cfg/default \ | ||
21 | -v <path to bzImage>:/var/lib/tftpboot/bzImage \ | ||
22 | -v <path to rootfs.ext4>:/var/lib/tftpboot/rootfs.ext4 \ | ||
23 | <CONTAINER_NAME> <INTERFACE_NAME> | ||
24 | |||
25 | 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: | ||
26 | docker run -it --net=host --privileged \ | ||
27 | -v $(pwd)/dhcpd.conf:/etc/dhcp/dhcpd.conf \ | ||
28 | -v $(pwd)/pxe.cfg:/var/lib/tftpboot/pxelinux.cfg/default \ | ||
29 | -v $(pwd)/bzImage:/var/lib/tftpboot/bzImage \ | ||
30 | -v $(pwd)/rootfs.ext4:/var/lib/tftpboot/rootfs.ext4 \ | ||
31 | nfv-pxe-boot eth2 | ||
32 | |||
33 | 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. | ||
34 | |||
35 | Boot the board with network booting enabled and it should load the configuration set in pxe.cfg. | ||
36 | |||
37 | 3. Start a container with only the DHCP server running: | ||
38 | - Only dhcpd.conf is needed | ||
39 | - Set an IP address to the interface (named INTERFACE_NAME below) where the DHCP server will be advertised on | ||
40 | - Run: | ||
41 | docker run -it --net=host --privileged -v <path to dhcpd.conf>:/etc/dhcp/dhcpd.conf <INTERFACE NAME> | ||