Dockerfile: Streamline installed packages

Remove unused packages or more specific dependencies. In particular use
the packaged virtiofsd to avoid compiling it.

Signed-off-by: Rob Bradford <robert.bradford@intel.com>
This commit is contained in:
Rob Bradford 2022-02-17 16:35:10 +00:00
parent 98bbfa9738
commit d27316dab6

View File

@ -14,38 +14,37 @@ ENV PATH="$PATH:$CARGO_HOME/bin"
# Install all CI dependencies # Install all CI dependencies
RUN apt-get update \ RUN apt-get update \
&& apt-get -yq upgrade \ && apt-get -yq upgrade \
&& DEBIAN_FRONTEND=noninteractive apt-get install -yq \ && DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends --no-install-suggests -yq \
build-essential \
bc \ bc \
docker.io \ bison \
build-essential \
ca-certificates \
cpio \
curl \ curl \
wget \ dosfstools \
sudo \ flex \
git-core \
iperf3 \
libcap-ng-dev \
libelf-dev \
libseccomp-dev \
libssl-dev \
mtools \ mtools \
musl-tools \ musl-tools \
libssl-dev \
pkg-config \
flex \
bison \
libelf-dev \
qemu-utils \
qemu-system \
libglib2.0-dev \
libpixman-1-dev \
libseccomp-dev \
libcap-ng-dev \
socat \
dosfstools \
cpio \
python \
python3 \
python3-setuptools \
ntfs-3g \ ntfs-3g \
openvswitch-switch-dpdk \ openvswitch-switch-dpdk \
pkg-config \
python \
python3 \
python3-distutils \ python3-distutils \
python3-setuptools \
qemu-system-common \
qemu-utils \
socat \
sudo \
unzip \
uuid-dev \ uuid-dev \
iperf3 \ wget \
zip \
&& apt-get clean \ && apt-get clean \
&& rm -rf /var/lib/apt/lists/* && rm -rf /var/lib/apt/lists/*
@ -54,7 +53,7 @@ RUN update-alternatives --set ovs-vswitchd /usr/lib/openvswitch-switch-dpdk/ovs-
RUN if [ "$TARGETARCH" = "amd64" ]; then \ RUN if [ "$TARGETARCH" = "amd64" ]; then \
apt-get update \ apt-get update \
&& apt-get -yq upgrade \ && apt-get -yq upgrade \
&& DEBIAN_FRONTEND=noninteractive apt-get install -yq gcc-multilib \ && DEBIAN_FRONTEND=noninteractive apt-get install -yq --no-install-recommends --no-install-suggests gcc-multilib \
&& apt-get clean \ && apt-get clean \
&& rm -rf /var/lib/apt/lists/*; fi && rm -rf /var/lib/apt/lists/*; fi
@ -65,7 +64,7 @@ RUN if [ "$TARGETARCH" = "arm64" ]; then \
# kernel (any version) image in `/boot` and modules in `/lib/modules`. # kernel (any version) image in `/boot` and modules in `/lib/modules`.
apt-get update \ apt-get update \
&& apt-get -yq upgrade \ && apt-get -yq upgrade \
&& DEBIAN_FRONTEND=noninteractive apt-get install -yq \ && DEBIAN_FRONTEND=noninteractive apt-get install -yq --no-install-recommends --no-install-suggests \
libcap2-bin \ libcap2-bin \
libguestfs-tools \ libguestfs-tools \
linux-image-5.8.0-63-generic \ linux-image-5.8.0-63-generic \
@ -104,13 +103,6 @@ RUN echo 'source $CARGO_HOME/env' >> $HOME/.bashrc \
&& mkdir $HOME/.cargo \ && mkdir $HOME/.cargo \
&& ln -s $CARGO_HOME/env $HOME/.cargo/env && ln -s $CARGO_HOME/env $HOME/.cargo/env
# install virtiofsd
RUN git clone --depth 1 https://gitlab.com/virtio-fs/qemu.git -b qemu5.0-virtiofs-dax \
&& cd qemu \
&& ./configure --prefix=$PWD --target-list=x86_64-softmmu \
&& make virtiofsd -j `nproc` \
&& cp virtiofsd /usr/local/bin \
&& cd .. && rm -rf qemu
# install SPDK NVMe # install SPDK NVMe
# only for 'x86_64' platform images as 'docker buildx' can't build 'spdk' # only for 'x86_64' platform images as 'docker buildx' can't build 'spdk'
@ -133,4 +125,4 @@ RUN if [ "$TARGETARCH" = "amd64" ]; then \
RUN wget https://github.com/microsoft/ethr/releases/latest/download/ethr_linux.zip \ RUN wget https://github.com/microsoft/ethr/releases/latest/download/ethr_linux.zip \
&& unzip ethr_linux.zip \ && unzip ethr_linux.zip \
&& cp ethr /usr/local/bin \ && cp ethr /usr/local/bin \
&& rm ethr_linux.zip && rm ethr_linux.zip