Sign inSign up

vagabondan/pxe

By vagabondan

Updated over 8 years ago

Dockerized Linux network installation server (PXE server)

Image
0

1.1K

vagabondan/pxe repository overview

Docker image for PXE server

This Docker image is suitable for running a DHCP + TFTP + HTTP servers for your docker host network. It uses ISC DHCP, TFTP, Apache2 servers which are bundled with the latest Ubuntu LTS distribution.

Many thanks to @networkboot(https://github.com/networkboot)! Their ideas in dockerizing DHCP server lay into the basis of this repository.

How to build

  1. Install Docker with the instructions on https://www.docker.com.
  2. Run ./build to create the local docker image vagabondan/pxe.

TEXT BELOW IS UNDER CONSTRUCTION

How to use

The most common use-case is to provide DHCP service to the host network of the machine running Docker. For that you need to create a configuration for the DHCP server, start the container with the --net=host docker run option and specify the network interface you want to provide DHCP service on.

  1. Create dhcp folder.
  2. Create dhcp/dhcpd.conf with a subnet clause for the specified network interface. If you need assistance, you can run docker run -it --rm networkboot/dhcpd man dhcpd.conf for a description of the configuration file syntax.
  3. Run docker run -it --rm --net=host -v "$(pwd)/dhcp":/dhcp networkboot/dhcpd eth0. dhcpd will automatically start and display its logs on the console. You can press Ctrl-C to terminate the server.

A simple run script is also included which makes it quick to iterate on a configuration until you're satisfied.

Notes

The entrypoint script in the docker image takes care of running the DHCP server as the same user that owns the dhcp folder. This ensures that the permissions on the files inside the dhcp folder is kept consistent. If the dhcp folder is owned by root, dhcpd is run as the normal dhcpd user.

If you forget to run the docker container with the --net=host option a warning will be emitted informing you that you've probably forgotten it.

If a /dhcp volume is not provided with a dhcpd.conf inside it, the container will exit early with an error message.

===========================================================================

Acknowledgements

This image uses the following software components:

This project is copyright 2018 Vagabondan [email protected].

It is licensed under the MIT license.

Tag summary

Content type

Image

Digest

Size

530.5 MB

Last updated

over 8 years ago

docker pull vagabondan/pxe