Last active
August 13, 2020 06:39
-
-
Save tarasglek/32dd14f398dd27ed97fbc2d06f86a3fe to your computer and use it in GitHub Desktop.
Use docker to generate a baremetal-friendly iso image
This file contains 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
# docker build -t linux-live . | |
# docker run -ti -v `pwd`/out:/tmp linux-live ./build-perf.sh | |
# kvm -cdrom out/linux-x86_64.iso | |
FROM ubuntu:18.04 | |
RUN echo deb http://us.archive.ubuntu.com/ubuntu bionic-backports main restricted universe multiverse >> /etc/apt/sources.list | |
RUN apt update | |
ARG DEBIAN_FRONTEND=noninteractive | |
ENV KERNEL 5.4.0-37-generic | |
RUN apt-get install --no-install-recommends -y linux-image-$KERNEL git squashfs-tools mkisofs zip xz-utils systemd-sysv ca-certificates vim-nox cpio sudo iproute2 networkd-dispatcher network-manager networkd-dispatcher netplan pciutils | |
WORKDIR /root | |
RUN git clone https://github.com/Tomas-M/linux-live | |
WORKDIR /root/linux-live | |
RUN sed -i "s:^KERNEL.*:KERNEL=$KERNEL:" config | |
RUN sed -i 's/TIMEOUT 140/TIMEOUT 1/' bootfiles/syslinux.cfg | |
RUN sed -i 's/ALL$/NOPASSWD:ALL/' /etc/sudoers | |
RUN echo "[Network]\nDHCP=yes" >> /etc/systemd/network/00-dhcp.network | |
RUN echo "\n[keyfile]\nunmanaged-devices=*,except:type:ethernet\n" >> /etc/NetworkManager/NetworkManager.conf |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment