Skip to content

Commit 18a8cda

Browse files
committed
chore(devctr): add qemu vhost-user-blk backend
Builds the backend from source at the devctr build time and installs the binary at /usr/local/bin/vhost-user-blk . This also installs a runtime dependency: libglib2.0-dev . Increases the image size by about 80M. Signed-off-by: Nikita Kalyazin <[email protected]>
1 parent 93a3194 commit 18a8cda

File tree

3 files changed

+389
-301
lines changed

3 files changed

+389
-301
lines changed

tools/devctr/Dockerfile

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,31 @@ ENV CARGO_HOME=/usr/local/rust
1717
ENV RUSTUP_HOME=/usr/local/rust
1818
ENV PATH="$PATH:$CARGO_HOME/bin"
1919
ENV LC_ALL=C.UTF-8
20+
ENV QEMU_VER="8.1.1"
21+
22+
# Build and install Qemu vhost-user-blk backend
23+
#
24+
RUN apt-get update \
25+
&& apt-get -y install --no-install-recommends \
26+
curl gpg gpg-agent \
27+
python3-pip build-essential ninja-build libglib2.0-dev libpixman-1-dev flex bison \
28+
&& pip3 install meson \
29+
&& mkdir /tmp/qemu_build && cd /tmp/qemu_build \
30+
&& curl -sLO https://keys.openpgp.org/vks/v1/by-fingerprint/CEACC9E15534EBABB82D3FA03353C9CEF108B584 \
31+
&& curl -sLO https://download.qemu.org/qemu-${QEMU_VER}.tar.xz \
32+
&& curl -sLO https://download.qemu.org/qemu-${QEMU_VER}.tar.xz.sig \
33+
&& gpg --import CEACC9E15534EBABB82D3FA03353C9CEF108B584 \
34+
&& gpg --verify qemu-${QEMU_VER}.tar.xz.sig qemu-${QEMU_VER}.tar.xz \
35+
&& tar xf qemu-${QEMU_VER}.tar.xz && cd qemu-${QEMU_VER} \
36+
&& ./configure && make -j $(nproc) contrib/vhost-user-blk/vhost-user-blk \
37+
&& strip ./build/contrib/vhost-user-blk/vhost-user-blk \
38+
&& cp -a ./build/contrib/vhost-user-blk/vhost-user-blk /usr/local/bin \
39+
&& pip3 uninstall -y meson \
40+
&& apt-get purge -y \
41+
curl gpg gpg-agent \
42+
python3-pip build-essential ninja-build libglib2.0-dev libpixman-1-dev flex bison \
43+
&& apt-get autoremove -y \
44+
&& cd && rm -r /tmp/qemu_build
2045

2146
# Install system dependencies
2247
#
@@ -59,6 +84,8 @@ RUN apt-get update \
5984
dmidecode \
6085
# for aws-lc-rs
6186
cmake \
87+
# for Qemu vhost-user-blk backend
88+
libglib2.0-dev \
6289
&& rm -rf /var/lib/apt/lists/* \
6390
&& pip3 install --upgrade pip poetry \
6491
&& gem install mdl

0 commit comments

Comments
 (0)