Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can we see your Dockerfile & docker-compose file for hub/docker.com/samdbmg/dhcp-netboot.xyz:latest ? #13

Open
williamblair333 opened this issue Nov 9, 2023 · 2 comments

Comments

@williamblair333
Copy link

I was watching your youtube video and think it's awesome although I'm unsure how it's all set up under the hood. I'd like to see what you've done and learn from / tailor it for me. Or point me to a good guide. Thanks.

@zyssai
Copy link

zyssai commented Nov 9, 2023

Hi.
Long time that I have not managed with netboot, but it is always working.
Hope this helps.

# TO DEPLOY:
# docker-compose -f docker-compose.yml up -d

version: "3.9"

########################### NETWORKS

  netbootxyz_network:
    external: true



########################### SERVICES
services:

    # Autoindex - Simple Directory Index
  autoindex:
    container_name: autoindex
    image: dceoy/nginx-autoindex:latest
    restart: unless-stopped
    networks:
      netbootxyz_network:
        ipv4_address: $AUTOINDEX_IP
    ports:
      - "$AUTOINDEX_PORT:80"
    environment:
      - TZ=$TZ
      - PUID=$PUID
      - PGID=$PGID
    volumes:
      - $PXEDIR:/var/lib/nginx/html:ro # Location you want to index
      - /etc/timezone:/etc/timezone:ro
      - /etc/localtime:/etc/localtime:ro
    

  # NETBOOTXYZ PXE NETWORK BOOT MANAGEMENT
#
# CREATE NETWORK BEFORE WITH THIS COMMAND (EDIT NETWORK INTERFACE):
# docker network create --driver=ipvlan --gateway=192.168.0.254 --subnet=192.168.0.2/24 --ip-range=192.168.0.100/32 -o parent=enp4s0 netbootxyz_network
#
# if error with menus.tar.gz, run this:
# docker exec -it netbootxyz /bin/bash
# cd tmp
# wget https://github.com/netbootxyz/netboot.xyz/releases/download/2.0.57/menus.tar.gz
#
# TO ACCESS ASSETS FROM BOOTED COMPUTER, USE THIS URL:
# HTTP://192.168.0.xxx (IP from autoindex container)
#
# TO MAKE THIS PERMANENT, EDIT ./netbootxyz/config/menus/boot.cfg
# set win_base_url http://192.168.0.xxx (IP from autoindex container)

#
  netbootxyz:
    container_name: netbootxyz
    image: samdbmg/dhcp-netboot.xyz:latest
    environment:
      - TZ=$TZ
      - PUID=$PUID
      - PGID=$PGID
      - DHCP_RANGE_START=$SUBNET
    restart: unless-stopped
    networks:
      netbootxyz_network:
        ipv4_address: $CONTAINER_IP
    ports:
      - 3000:3000
      - 69:69/udp
#      - 8080:80 #optional
    cap_add:
      - NET_ADMIN
    volumes:
      - $DOCKERDIR/netbootxyz:/etc/netbootxyz
      - $DOCKERDIR/netbootxyz/config:/config
      - $PXEDIR:/assets

And .env file


##### PORTS

AUTOINDEX_PORT=80
AUTOINDEX_IP=192.168.0.251

##### SYSTEM
PUID=1000
PGID=1000
TZ=Europe/Paris
SERVER_IP=192.168.0.40
LOCAL_NETWORK=192.168.0.0/24
NETWORK_INTERFACE=enp4s0

#NETBOOTXYZ
GATEWAY=192.168.0.254
SUBNET=192.168.0.2
SUBNET_PREFIX_BITS=24
CONTAINER_IP=192.168.0.250
IP_RANGE=192.168.0.252/32

##### FOLDERS
USERDIR=/home/xxxxxx
DOCKERDIR=/home/xxxxxx/docker
PXEDIR=/mnt/HDD4/PXE/assets

@samdbmg
Copy link
Owner

samdbmg commented Nov 9, 2023

@zyssai has a nice practical example and some tips, https://github.com/samdbmg/dhcp-netboot.xyz/blob/main/docker-compose.yml should serve as a useful minimal example, but pay attention to the notes in https://github.com/samdbmg/dhcp-netboot.xyz#option-2-docker-compose or their Compose file above about setting up networking.

As for the Dockerfile, it's https://github.com/samdbmg/dhcp-netboot.xyz/blob/main/Dockerfile - GitHub Actions builds that and pushes it to Docker Hub at https://hub.docker.com/r/samdbmg/dhcp-netboot.xyz

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants