Files
Jan Čermák 834c51ca84 Create VM image .zip files in parallel using pigz (#4067)
When creating OVA image, the CPU is slacking at the end of the build because it
is creating three ZIP archives, each one on a single CPU only. As we're
creating only single-entry archives, we can use pigz to use all cores.

The actual speedup on my machine (16C/32T) reflects the number of cores - it
takes around 2 seconds instead of 1 minute.
2025-05-19 12:43:23 +02:00

62 lines
1.5 KiB
Docker

FROM debian:bullseye
# Set shell
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
# Docker
RUN apt-get update && apt-get install -y --no-install-recommends \
apt-transport-https \
ca-certificates \
curl \
gpg-agent \
gpg \
dirmngr \
software-properties-common \
&& curl -fsSL https://download.docker.com/linux/debian/gpg | gpg --dearmor -o /etc/apt/trusted.gpg.d/docker.gpg \
&& echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/trusted.gpg.d/docker.gpg] \
https://download.docker.com/linux/debian $(lsb_release -cs) stable" > /etc/apt/sources.list.d/docker.list \
&& apt-get update && apt-get install -y --no-install-recommends \
docker-ce \
&& rm -rf /var/lib/apt/lists/*
# Build tools
RUN apt-get update && apt-get install -y --no-install-recommends \
automake \
bash \
bc \
binutils \
build-essential \
bzip2 \
cpio \
file \
git \
graphviz \
help2man \
jq \
make \
ncurses-dev \
openssh-client \
patch \
perl \
pigz \
python3 \
python3-matplotlib \
python-is-python3 \
qemu-utils \
rsync \
skopeo \
sudo \
texinfo \
unzip \
vim \
wget \
zip \
&& rm -rf /var/lib/apt/lists/*
# Init entry
COPY scripts/entry.sh /usr/sbin/
ENTRYPOINT ["/usr/sbin/entry.sh"]
# Get buildroot
WORKDIR /build