summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--nfv-installer/docker-pxe-ramboot/Dockerfile16
-rw-r--r--nfv-installer/docker-pxe-ramboot/README41
-rw-r--r--nfv-installer/docker-pxe-ramboot/dhcpd.conf6
-rwxr-xr-xnfv-installer/docker-pxe-ramboot/entrypoint.sh6
-rw-r--r--nfv-installer/docker-pxe-ramboot/pxe.cfg9
5 files changed, 78 insertions, 0 deletions
diff --git a/nfv-installer/docker-pxe-ramboot/Dockerfile b/nfv-installer/docker-pxe-ramboot/Dockerfile
new file mode 100644
index 0000000..f515cd3
--- /dev/null
+++ b/nfv-installer/docker-pxe-ramboot/Dockerfile
@@ -0,0 +1,16 @@
1FROM ubuntu:16.04
2
3RUN apt-get update && \
4 apt-get install -y isc-dhcp-server tftpd-hpa wget
5
6RUN touch /var/lib/dhcp/dhcpd.leases
7
8RUN wget http://ftp.debian.org/debian/dists/wheezy/main/installer-amd64/current/images/netboot/netboot.tar.gz && \
9 mkdir /netboot && \
10 tar -zxf netboot.tar.gz -C /netboot && \
11 cp /netboot/debian-installer/amd64/pxelinux.0 /var/lib/tftpboot/pxelinux.0 && \
12 cp /netboot/debian-installer/amd64/boot-screens/vesamenu.c32 /var/lib/tftpboot/
13
14COPY ./entrypoint.sh /entrypoint.sh
15
16ENTRYPOINT ["/entrypoint.sh"]
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
2This container starts a DHCP server and a TFTP server which can be used for booting boards through PXE.
3
41. Build the container
5 - cd into this folder
6 - run:
7 docker build . -t <CONTAINER_NAME>
8
92. 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
373. 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>
diff --git a/nfv-installer/docker-pxe-ramboot/dhcpd.conf b/nfv-installer/docker-pxe-ramboot/dhcpd.conf
new file mode 100644
index 0000000..21df511
--- /dev/null
+++ b/nfv-installer/docker-pxe-ramboot/dhcpd.conf
@@ -0,0 +1,6 @@
1default-lease-time 600;
2max-lease-time 7200;
3subnet 192.168.1.0 netmask 255.255.255.0 {
4 range 192.168.1.100 192.168.1.200;
5 filename "/var/lib/tftpboot/pxelinux.0";
6}
diff --git a/nfv-installer/docker-pxe-ramboot/entrypoint.sh b/nfv-installer/docker-pxe-ramboot/entrypoint.sh
new file mode 100755
index 0000000..0930cb9
--- /dev/null
+++ b/nfv-installer/docker-pxe-ramboot/entrypoint.sh
@@ -0,0 +1,6 @@
1#!/usr/bin/env bash
2echo "Starting DHCP on interface: $1"
3
4/usr/sbin/dhcpd --no-pid $1
5nohup in.tftpd -L&
6/bin/bash
diff --git a/nfv-installer/docker-pxe-ramboot/pxe.cfg b/nfv-installer/docker-pxe-ramboot/pxe.cfg
new file mode 100644
index 0000000..ee26ae3
--- /dev/null
+++ b/nfv-installer/docker-pxe-ramboot/pxe.cfg
@@ -0,0 +1,9 @@
1default vesamenu.c32
2
3MENU TITLE Enea NFV Access Install
4MENU COLOR title 0 #80ffffff #00000000 std
5
6label Run RAMFS
7 menu label ^Run RAMFS
8 kernel bzImage
9 append root=/dev/ram0 initrd=rootfs.ext4 ramdisk_size=2000000 console=ttyS0,115200 earlyprintk=ttyS0,115200