Skip to content

sjqzhang/docker-netbooter

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Docker Alpine Netboot Server

Docker Automated build Docker Pulls

Provides everything you need to PXE boot any machine (BIOS/UEFI).

Non-iPXE booting machines will be "upgraded" to iPXE.

Contains a TFTP, DHCP and HTTP server. The HTTP server runs on port 8069 by default for safe usage with other services using port 80. The DHCP server can be disabled.

Example usage

  • Create a folder to store your boot images and menu.ipxe file. There is an example menu.ipxe in the repo.
  • Run the container:
docker run --rm -d --net host --name=netbooter -v /path/to/httproot:/netboot/httproot \
	-e DOMAINNAME=localdomain \
	-e DNSSERVERS="8.8.8.8,192.168.56.1" \
	-e NETPREFIX=192.168.56 \
	-e RANGESTART=50 \
	-e RANGEEND=100 \
	m1cr0man/netbooter:latest

Note: If you want to use your own DHCP server just don't specify the environment variables.

Example docker-compose.yml

version: '3.4'
services:
  netbooter:
    image: m1cr0man/netbooter:latest
    restart: always
    network: host
    environment:
      DOMAINNAME: localdomain
      DNSSERVERS: 8.8.8.8,192.168.56.1
      NETPREFIX: 192.168.56
      RANGESTART: 50
      RANGEEND: 100
    volumes:
      - ./path/to/httproot:/netboot/httproot:ro

Configuration options

Environment variables:

  • DOMAINNAME: Domain to pass to clients via DHCP
  • DNSSERVERS: Comma separated list of DNS servers
  • NETPREFIX: The first 3 digits of the IPv4 address range you want to serve. No trailing dot.
  • RANGESTART: The first IP address to serve. Prefixed with the NETPREFIX
  • RANGEEND: The last IP address to serve. Prefixed with the NETPREFIX

Leave these settings out to disable the DHCP server.

Adding images

  • Download the necessary netboot files for the image you want to use (e.g. initrd + vmlinuz)
  • Copy these files to your httproot folder
  • Add a section to your menu.ipxe to provide an option to select this OS. The example menu.ipxe includes a section for Rancher OS installer which you can copy/edit.

For more information on writing the menu.ipxe see the iPXE docs

Usage from Github

A Makefile is provided for conveniently building + running the container. Simply run make to do both, or run make [build|run] for the individual parts.

It is recommended to edit the run target to suit your own environment/needs.

About

Provides DHCP, TFTP and HTTP with embedded iPXE ROMs

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Makefile 38.3%
  • Dockerfile 37.0%
  • Shell 24.7%