|
1 | 1 | FROM alpine:3.21 |
2 | 2 |
|
3 | | -RUN mkdir -p /tftpboot; \ |
4 | | - apk --update add --no-cache tftp-hpa busybox |
| 3 | +# Install necessary packages and create directories |
| 4 | +RUN mkdir -p /httpboot/ipxe && \ |
| 5 | + apk --update add --no-cache tftp-hpa busybox nginx envsubst && \ |
| 6 | + # Download boot files |
| 7 | + wget -P /httpboot https://boot.ipxe.org/ipxe.efi && \ |
| 8 | + wget -P /httpboot https://boot.ipxe.org/ipxe.pxe && \ |
| 9 | + wget -P /httpboot https://boot.ipxe.org/undionly.kpxe && \ |
| 10 | + wget -P /httpboot https://boot.ipxe.org/snponly.efi && \ |
| 11 | + wget -P /httpboot https://github.com/ipxe/wimboot/releases/latest/download/wimboot && \ |
| 12 | + wget -P /httpboot https://boot.netboot.xyz/ipxe/netboot.xyz.kpxe && \ |
| 13 | + wget -P /httpboot https://boot.netboot.xyz/ipxe/netboot.xyz-undionly.kpxe && \ |
| 14 | + wget -P /httpboot https://boot.netboot.xyz/ipxe/netboot.xyz.efi && \ |
| 15 | + wget -P /httpboot https://boot.netboot.xyz/ipxe/netboot.xyz-snp.efi && \ |
| 16 | + wget -P /httpboot https://boot.netboot.xyz/ipxe/netboot.xyz-snponly.efi && \ |
| 17 | + wget -P /httpboot https://boot.netboot.xyz/ipxe/netboot.xyz-arm64.efi && \ |
| 18 | + wget -P /httpboot https://boot.netboot.xyz/ipxe/netboot.xyz-arm64-snp.efi && \ |
| 19 | + wget -P /httpboot https://boot.netboot.xyz/ipxe/netboot.xyz-arm64-snponly.efi && \ |
| 20 | + # Set permissions |
| 21 | + find /httpboot -type f -exec chmod 0444 {} + |
5 | 22 |
|
| 23 | +# Set default environment variables for ports |
| 24 | +ENV TFTP_PORT=69 |
| 25 | +ENV HTTP_PORT=80 |
| 26 | + |
| 27 | +# Expose ports |
6 | 28 | EXPOSE 69/udp |
| 29 | +EXPOSE 80 |
7 | 30 |
|
8 | | -ADD https://boot.netboot.xyz/ipxe/netboot.xyz.kpxe /tftpboot/ |
9 | | -ADD https://boot.netboot.xyz/ipxe/netboot.xyz-undionly.kpxe /tftpboot/ |
10 | | -ADD https://boot.netboot.xyz/ipxe/netboot.xyz.efi /tftpboot/ |
11 | | -ADD https://boot.netboot.xyz/ipxe/netboot.xyz-snp.efi /tftpboot/ |
12 | | -ADD https://boot.netboot.xyz/ipxe/netboot.xyz-snponly.efi /tftpboot/ |
13 | | -ADD https://boot.netboot.xyz/ipxe/netboot.xyz-arm64.efi /tftpboot/ |
14 | | -ADD https://boot.netboot.xyz/ipxe/netboot.xyz-arm64-snp.efi /tftpboot/ |
15 | | -ADD https://boot.netboot.xyz/ipxe/netboot.xyz-arm64-snponly.efi /tftpboot/ |
16 | | -ADD https://boot.netboot.xyz/ipxe/netboot.xyz-rpi4-snp.efi /tftpboot/ |
| 31 | +# Copy scripts and configuration files |
| 32 | +COPY entrypoint.sh /entrypoint.sh |
| 33 | +COPY generate_index.sh /generate_index.sh |
| 34 | +COPY nginx.conf /etc/nginx/nginx.conf |
17 | 35 |
|
18 | | -RUN find /tftpboot -type f -exec chmod 0444 {} + |
| 36 | +# Make scripts executable |
| 37 | +RUN chmod +x /entrypoint.sh /generate_index.sh |
19 | 38 |
|
20 | | -ENTRYPOINT ["sh", "-c"] |
21 | | -CMD ["busybox syslogd -n -O /dev/stdout & in.tftpd -Lvvv --secure -u nobody /tftpboot"] |
| 39 | +# Set entrypoint |
| 40 | +ENTRYPOINT ["/entrypoint.sh"] |
0 commit comments