-
Notifications
You must be signed in to change notification settings - Fork 57
/
Dockerfile
40 lines (33 loc) · 1.46 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
FROM alpine:3.20.3
LABEL maintainer "[email protected]"
# Install the necessary packages
RUN apk add --no-cache \
dnsmasq \
wget
ENV MEMTEST_VERSION 5.31b
ENV SYSLINUX_VERSION 6.03
ENV TEMP_SYSLINUX_PATH /tmp/syslinux-"$SYSLINUX_VERSION"
WORKDIR /tmp
RUN \
mkdir -p "$TEMP_SYSLINUX_PATH" \
&& wget -q https://www.kernel.org/pub/linux/utils/boot/syslinux/syslinux-"$SYSLINUX_VERSION".tar.gz \
&& tar -xzf syslinux-"$SYSLINUX_VERSION".tar.gz \
&& mkdir -p /var/lib/tftpboot \
&& cp "$TEMP_SYSLINUX_PATH"/bios/core/pxelinux.0 /var/lib/tftpboot/ \
&& cp "$TEMP_SYSLINUX_PATH"/bios/com32/libutil/libutil.c32 /var/lib/tftpboot/ \
&& cp "$TEMP_SYSLINUX_PATH"/bios/com32/elflink/ldlinux/ldlinux.c32 /var/lib/tftpboot/ \
&& cp "$TEMP_SYSLINUX_PATH"/bios/com32/menu/menu.c32 /var/lib/tftpboot/ \
&& rm -rf "$TEMP_SYSLINUX_PATH" \
&& rm /tmp/syslinux-"$SYSLINUX_VERSION".tar.gz \
&& wget -q http://www.memtest.org/download/archives/"$MEMTEST_VERSION"/memtest86+-"$MEMTEST_VERSION".bin.gz \
&& gzip -d memtest86+-"$MEMTEST_VERSION".bin.gz \
&& mkdir -p /var/lib/tftpboot/memtest \
&& mv memtest86+-$MEMTEST_VERSION.bin /var/lib/tftpboot/memtest/memtest86+
# Configure PXE and TFTP
COPY tftpboot/ /var/lib/tftpboot
# Configure DNSMASQ
COPY etc/ /etc
# Start dnsmasq. It picks up default configuration from /etc/dnsmasq.conf and
# /etc/default/dnsmasq plus any command line switch
ENTRYPOINT ["dnsmasq", "--no-daemon"]
CMD ["--dhcp-range=192.168.56.2,proxy"]