Last active
February 12, 2020 17:27
-
-
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)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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