Giter Site home page Giter Site logo

changsongyang / docker-netbooter Goto Github PK

View Code? Open in Web Editor NEW

This project forked from m1cr0man/docker-netbooter

0.0 2.0 0.0 14 KB

Provides DHCP, TFTP and HTTP with embedded iPXE ROMs

Home Page: https://hub.docker.com/r/m1cr0man/netbooter

License: Apache License 2.0

Dockerfile 36.98% Makefile 38.37% Shell 24.65%

docker-netbooter's Introduction

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.

docker-netbooter's People

Contributors

m1cr0man avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.