Skip to content

Instantly share code, notes, and snippets.

@C-Duv
Last active February 12, 2020 17:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save C-Duv/a8f53142ddf6c78f4b794d74affb5500 to your computer and use it in GitHub Desktop.
Save C-Duv/a8f53142ddf6c78f4b794d74affb5500 to your computer and use it in GitHub Desktop.
Commands to build ipxe files via Docker (using a Debian 10.2 image)
# Path where to work
IPXE_DIRPATH="/opt/ipxe"
# Create some directories
mkdir -p "${IPXE_DIRPATH}/"{ipxe_project,builder}
# Fetch iPXE source files
cd "${IPXE_DIRPATH}/ipxe_project"
git clone https://github.com/ipxe/ipxe.git .
# Create the Docker builder image
cd "${IPXE_DIRPATH}/builder"
cat > ./Dockerfile <<'EOT'
# Docker image to build ipxe files
#
# References:
# * https://ipxe.org/download
FROM debian:10.2
RUN \
apt-get --assume-yes --quiet update && \
apt-get --assume-yes --quiet --no-install-recommends install \
binutils \
build-essential \
gcc \
genisoimage \
git \
isolinux \
liblzma-dev \
make \
mtools \
perl \
syslinux \
syslinux-common \
&& \
apt-get --assume-yes --quiet clean && \
apt-get --assume-yes --quiet autoremove && \
rm -rf /var/lib/apt/lists/* && \
true # No-op command to avoid "Empty continuation line" warning
WORKDIR /ipxe_sources
VOLUME /ipxe_sources
CMD ["sh", "-c", "cd src && make"]
EOT
# Run it
docker build -t "my_ipxe_builder" .
docker run --rm -v "${IPXE_DIRPATH}/ipxe_project":/ipxe_sources my_ipxe_builder
# It will create the following files in ${IPXE_DIRPATH}/ipxe_project/src :
# * bin/ipxe.dsk
# * bin/ipxe.lkrn
# * bin/ipxe.iso
# * bin/ipxe.usb
# * bin/ipxe.pxe
# * bin/undionly.kpxe
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment