You must setup Podman first.

Steps

  1. create ipxe directory in $HOME/podman
    mkdir -p ~/podman/ipxe && cd ~/podman/ipxe
    
  2. copy from compose.yml
    nano compose.yml
    
  3. create necessary directories
    mkdir -p www/html/{clonezilla,gparted}
    
  4. download necessary files
    curl -Lo www/html/clonezilla/filesystem.squashfs download.freaks.dev/ipxe/clonezilla/filesystem.squashfs
    curl -Lo www/html/clonezilla/vmlinuz download.freaks.dev/ipxe/clonezilla/vmlinuz
    curl -Lo www/html/clonezilla/initrd.img download.freaks.dev/ipxe/clonezilla/initrd.img
    curl -Lo www/html/gparted/filesystem.squashfs download.freaks.dev/ipxe/gparted/filesystem.squashfs
    curl -Lo www/html/gparted/vmlinuz download.freaks.dev/ipxe/gparted/vmlinuz
    curl -Lo www/html/gparted/initrd.img download.freaks.dev/ipxe/gparted/initrd.img
    
  5. copy from lighttpd.conf
    nano www/lighttpd.conf
    
  6. copy from custom.ipxe
    nano www/html/custom.ipxe
    
  7. start ipxe
    podman-compose -f ~/podman/ipxe/compose.yml systemd -a register
    systemctl --user enable --now podman-compose@ipxe
    

compose.yml

version: "3"
services:
  ipxe:
    image: docker.io/heinokesoe/lighttpd:latest
    container_name: ipxe
    network:
      - traefik
    volumes:
      - ./www:/var/www
    command: -D -f /var/www/lighttpd.conf
    restart: unless-stopped
    labels:
      - "io.containers.autoupdate=registry"
networks:
  traefik:
    external: true

custom.ipxe

#!ipxe

set server http://ipxe.freaks.dev
isset ${dhcp-server} && goto distro || goto static

:static
echo Failed to connect to DHCP Server.
echo -n IP Address: ${} && read netX/ip
echo -n Subnet Mask: ${} && read netX/netmask
echo -n Default Gateway: ${} && read netX/gateway
echo -n DNS: ${} && read dns
set ipparam ip=eth0:${netX/ip}:${netX/netmask}:${netX/gateway}:${dns}
goto distro

:distro
menu Custom IPXE
item --gap Choose distro:
item Alpine ${space} Alpine
item Archlinux ${space} Archlinux
item Clonezilla ${space} Clonezilla
item Gparted ${space} Gparted
choose distro || goto exit
goto ${distro}_boot

:Alpine_boot
imgfree
set repo-url http://mirror.fcix.net/alpine/latest-stable/main
set alpine-mirror http://mirror.fcix.net/alpine/latest-stable/releases/x86_64/netboot
isset ${dhcp-server} && set ipparam ip=dhcp || set ipparam ip=${netX/ip}::${netX/gateway}:${netX/netmask}::eth0:none:${dns}
kernel ${alpine-mirror}/vmlinuz-virt alpine_repo=${repo-url} modules=loop,squashfs modloop=${alpine-mirror}/modloop-virt nomodeset ${ipparam} initrd=initrd.magic
initrd ${alpine-mirror}/initramfs-virt
boot

:Archlinux_boot
imgfree
set archlinux-mirror http://23.152.160.16/archlinux/iso/latest
isset ${dhcp-server} && set ipparam ip=dhcp || set ipparam BOOTIF=${netX/mac} ip=${netX/ip}::${netX/gateway}:${netX/netmask}
set params archiso_http_srv=${archlinux-mirror}/ archisobasedir=arch ${ipparam} net.ifnames=0 initrd=initrd.magic
kernel ${archlinux-mirror}/arch/boot/x86_64/vmlinuz-linux ${params}
initrd ${archlinux-mirror}/arch/boot/x86_64/initramfs-linux.img
boot

:Clonezilla_boot
imgfree
kernel ${server}/clonezilla/vmlinuz boot=live username=user union=overlay config components noswap edd=on nomodeset ocs_live_run="ocs-live-general" ocs_live_batch=no net.ifnames=0 nosplash noprompt fetch=${server}/clonezilla/filesystem.squashfs ${ipparam}
initrd ${server}/clonezilla/initrd.img
boot

:Gparted_boot
imgfree
kernel ${server}/gparted/vmlinuz boot=live union=overlay username=user net.ifnames=0 vga=788 fetch=${server}/gparted/filesystem.squashfs ${ipparam}
initrd ${server}/gparted/initrd.img
boot

:exit
clear menu
exit 0