tests/docker: Refresh APT cache before installing new packages on Debian

Since docker caches the different layers, updating the package
list does not invalidate the previous "apt-get update" layer,
and it is likely "apt-get install" hits an outdated repository.

See commit beac6a98f6 and
https://docs.docker.com/develop/develop-images/dockerfile_best-practices/#apt-get

Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-Id: <20190723141528.18023-1-philmd@redhat.com>
[AJB: manually applies and fixed up]
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
This commit is contained in:
Philippe Mathieu-Daudé 2019-07-23 16:15:27 +02:00 committed by Alex Bennée
parent 30edd9fa50
commit 98808c3d0c
28 changed files with 133 additions and 101 deletions

View file

@ -6,7 +6,8 @@
#
FROM qemu:debian-sid
RUN DEBIAN_FRONTEND=noninteractive eatmydata \
apt-get install -y --no-install-recommends \
RUN apt update && \
DEBIAN_FRONTEND=noninteractive eatmydata \
apt install -y --no-install-recommends \
gcc-alpha-linux-gnu \
libc6.1-dev-alpha-cross || { echo "Failed to build - see debian-sid.docker notes"; exit 1; }

View file

@ -7,11 +7,13 @@
FROM qemu:debian9
MAINTAINER Philippe Mathieu-Daudé <f4bug@amsat.org>
RUN DEBIAN_FRONTEND=noninteractive eatmydata \
apt-get build-dep -yy qemu
RUN apt update && \
DEBIAN_FRONTEND=noninteractive eatmydata \
apt build-dep -yy qemu
RUN DEBIAN_FRONTEND=noninteractive eatmydata \
apt-get install -y --no-install-recommends \
RUN apt update && \
DEBIAN_FRONTEND=noninteractive eatmydata \
apt install -y --no-install-recommends \
libbz2-dev \
liblzo2-dev \
librdmacm-dev \
@ -19,8 +21,9 @@ RUN DEBIAN_FRONTEND=noninteractive eatmydata \
libvte-dev
# virgl
RUN DEBIAN_FRONTEND=noninteractive eatmydata \
apt-get install -y --no-install-recommends \
RUN apt update && \
DEBIAN_FRONTEND=noninteractive eatmydata \
apt install -y --no-install-recommends \
libegl1-mesa-dev \
libepoxy-dev \
libgbm-dev
@ -29,8 +32,9 @@ RUN git clone https://anongit.freedesktop.org/git/virglrenderer.git /usr/src/vir
RUN cd /usr/src/virglrenderer && ./autogen.sh && ./configure --with-glx --disable-tests && make install
# netmap
RUN DEBIAN_FRONTEND=noninteractive eatmydata \
apt-get install -y --no-install-recommends \
RUN apt update && \
DEBIAN_FRONTEND=noninteractive eatmydata \
apt install -y --no-install-recommends \
linux-headers-amd64
RUN git clone https://github.com/luigirizzo/netmap.git /usr/src/netmap
RUN cd /usr/src/netmap && git checkout v11.3

View file

@ -7,18 +7,20 @@ FROM qemu:debian9
# Add the foreign architecture we want and install dependencies
RUN dpkg --add-architecture arm64
RUN apt update
RUN DEBIAN_FRONTEND=noninteractive eatmydata \
apt-get install -y --no-install-recommends \
RUN apt update && \
DEBIAN_FRONTEND=noninteractive eatmydata \
apt install -y --no-install-recommends \
crossbuild-essential-arm64
RUN DEBIAN_FRONTEND=noninteractive eatmydata \
apt-get build-dep -yy -a arm64 qemu
RUN apt update && \
DEBIAN_FRONTEND=noninteractive eatmydata \
apt build-dep -yy -a arm64 qemu
# Specify the cross prefix for this image (see tests/docker/common.rc)
ENV QEMU_CONFIGURE_OPTS --cross-prefix=aarch64-linux-gnu-
RUN DEBIAN_FRONTEND=noninteractive eatmydata \
apt-get install -y --no-install-recommends \
RUN apt update && \
DEBIAN_FRONTEND=noninteractive eatmydata \
apt install -y --no-install-recommends \
libbz2-dev:arm64 \
liblzo2-dev:arm64 \
librdmacm-dev:arm64 \

View file

@ -8,16 +8,17 @@ MAINTAINER Philippe Mathieu-Daudé <f4bug@amsat.org>
# Add the foreign architecture we want and install dependencies
RUN dpkg --add-architecture armel && \
apt update
RUN apt install -yy crossbuild-essential-armel
RUN DEBIAN_FRONTEND=noninteractive eatmydata \
apt-get build-dep -yy -a armel qemu
apt update && \
apt install -yy crossbuild-essential-armel && \
DEBIAN_FRONTEND=noninteractive eatmydata \
apt build-dep -yy -a armel qemu
# Specify the cross prefix for this image (see tests/docker/common.rc)
ENV QEMU_CONFIGURE_OPTS --cross-prefix=arm-linux-gnueabi-
RUN DEBIAN_FRONTEND=noninteractive eatmydata \
apt-get install -y --no-install-recommends \
RUN apt update && \
DEBIAN_FRONTEND=noninteractive eatmydata \
apt install -y --no-install-recommends \
libbz2-dev:armel \
liblzo2-dev:armel \
librdmacm-dev:armel \

View file

@ -7,18 +7,20 @@ FROM qemu:debian9
# Add the foreign architecture we want and install dependencies
RUN dpkg --add-architecture armhf
RUN apt update
RUN DEBIAN_FRONTEND=noninteractive eatmydata \
apt-get install -y --no-install-recommends \
RUN apt update && \
DEBIAN_FRONTEND=noninteractive eatmydata \
apt install -y --no-install-recommends \
crossbuild-essential-armhf
RUN DEBIAN_FRONTEND=noninteractive eatmydata \
apt-get build-dep -yy -a armhf qemu
RUN apt update && \
DEBIAN_FRONTEND=noninteractive eatmydata \
apt build-dep -yy -a armhf qemu
# Specify the cross prefix for this image (see tests/docker/common.rc)
ENV QEMU_CONFIGURE_OPTS --cross-prefix=arm-linux-gnueabihf-
RUN DEBIAN_FRONTEND=noninteractive eatmydata \
apt-get install -y --no-install-recommends \
RUN apt update && \
DEBIAN_FRONTEND=noninteractive eatmydata \
apt install -y --no-install-recommends \
libbz2-dev:armhf \
liblzo2-dev:armhf \
librdmacm-dev:armhf \

View file

@ -9,7 +9,8 @@ FROM qemu:debian10
# Add the foreign architecture we want and install dependencies
RUN dpkg --add-architecture arm64
RUN apt update
RUN DEBIAN_FRONTEND=noninteractive eatmydata \
RUN apt update && \
DEBIAN_FRONTEND=noninteractive apt install -yy eatmydata && \
DEBIAN_FRONTEND=noninteractive eatmydata \
apt-get install -y --no-install-recommends \
crossbuild-essential-arm64

View file

@ -6,7 +6,8 @@
#
FROM qemu:debian-sid
RUN DEBIAN_FRONTEND=noninteractive eatmydata \
apt-get install -y --no-install-recommends \
RUN apt update && \
DEBIAN_FRONTEND=noninteractive eatmydata \
apt install -y --no-install-recommends \
gcc-hppa-linux-gnu \
libc6-dev-hppa-cross

View file

@ -6,7 +6,8 @@
#
FROM qemu:debian-sid
RUN DEBIAN_FRONTEND=noninteractive eatmydata \
apt-get install -y --no-install-recommends \
RUN apt update && \
DEBIAN_FRONTEND=noninteractive eatmydata \
apt install -y --no-install-recommends \
gcc-m68k-linux-gnu \
libc6-dev-m68k-cross

View file

@ -9,20 +9,22 @@ MAINTAINER Philippe Mathieu-Daudé <f4bug@amsat.org>
# Add the foreign architecture we want and install dependencies
RUN dpkg --add-architecture mips
RUN apt-get update
RUN DEBIAN_FRONTEND=noninteractive eatmydata \
apt-get install -y --no-install-recommends \
RUN apt update && \
DEBIAN_FRONTEND=noninteractive eatmydata \
apt install -y --no-install-recommends \
gcc-mips-linux-gnu
RUN DEBIAN_FRONTEND=noninteractive eatmydata \
apt-get build-dep -yy -a mips qemu
RUN apt update && \
DEBIAN_FRONTEND=noninteractive eatmydata \
apt build-dep -yy -a mips qemu
# Specify the cross prefix for this image (see tests/docker/common.rc)
ENV QEMU_CONFIGURE_OPTS --cross-prefix=mips-linux-gnu-
# Install extra libraries to increase code coverage
RUN DEBIAN_FRONTEND=noninteractive eatmydata \
apt-get install -y --no-install-recommends \
RUN apt update && \
DEBIAN_FRONTEND=noninteractive eatmydata \
apt install -y --no-install-recommends \
libbz2-dev:mips \
liblzo2-dev:mips \
librdmacm-dev:mips \

View file

@ -6,7 +6,8 @@
#
FROM qemu:debian-sid
RUN DEBIAN_FRONTEND=noninteractive eatmydata \
apt-get install -y --no-install-recommends \
RUN apt update && \
DEBIAN_FRONTEND=noninteractive eatmydata \
apt install -y --no-install-recommends \
gcc-mips64-linux-gnuabi64 \
libc6-dev-mips64-cross

View file

@ -10,20 +10,22 @@ MAINTAINER Philippe Mathieu-Daudé <f4bug@amsat.org>
# Add the foreign architecture we want and install dependencies
RUN dpkg --add-architecture mips64el && \
apt-get update
RUN DEBIAN_FRONTEND=noninteractive eatmydata \
apt-get install -y --no-install-recommends \
apt update && \
DEBIAN_FRONTEND=noninteractive eatmydata \
apt install -y --no-install-recommends \
gcc-mips64el-linux-gnuabi64
RUN DEBIAN_FRONTEND=noninteractive eatmydata \
apt-get build-dep -yy -a mips64el qemu
RUN apt update && \
DEBIAN_FRONTEND=noninteractive eatmydata \
apt build-dep -yy -a mips64el qemu
# Specify the cross prefix for this image (see tests/docker/common.rc)
ENV QEMU_CONFIGURE_OPTS --cross-prefix=mips64el-linux-gnuabi64-
# Install extra libraries to increase code coverage
RUN DEBIAN_FRONTEND=noninteractive eatmydata \
apt-get install -y --no-install-recommends \
RUN apt update && \
DEBIAN_FRONTEND=noninteractive eatmydata \
apt install -y --no-install-recommends \
libbz2-dev:mips64el \
liblzo2-dev:mips64el \
librdmacm-dev:mips64el \

View file

@ -9,20 +9,22 @@ MAINTAINER Philippe Mathieu-Daudé <f4bug@amsat.org>
# Add the foreign architecture we want and install dependencies
RUN dpkg --add-architecture mipsel
RUN apt-get update
RUN DEBIAN_FRONTEND=noninteractive eatmydata \
apt-get install -y --no-install-recommends \
RUN apt update && \
DEBIAN_FRONTEND=noninteractive eatmydata \
apt install -y --no-install-recommends \
gcc-mipsel-linux-gnu
RUN DEBIAN_FRONTEND=noninteractive eatmydata \
apt-get build-dep -yy -a mipsel qemu
RUN apt update && \
DEBIAN_FRONTEND=noninteractive eatmydata \
apt build-dep -yy -a mipsel qemu
# Specify the cross prefix for this image (see tests/docker/common.rc)
ENV QEMU_CONFIGURE_OPTS --cross-prefix=mipsel-linux-gnu-
# Install extra libraries to increase code coverage
RUN DEBIAN_FRONTEND=noninteractive eatmydata \
apt-get install -y --no-install-recommends \
RUN apt update && \
DEBIAN_FRONTEND=noninteractive eatmydata \
apt install -y --no-install-recommends \
libbz2-dev:mipsel \
liblzo2-dev:mipsel \
librdmacm-dev:mipsel \

View file

@ -18,8 +18,8 @@ RUN cat /etc/apt/sources.list | sed -ne "s/^deb\ \(\[.*\]\ \)\?\(.*\)/deb-src \2
# Setup some basic tools we need
RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install -yy eatmydata
RUN DEBIAN_FRONTEND=noninteractive eatmydata \
DEBIAN_FRONTEND=noninteractive apt install -yy eatmydata && \
DEBIAN_FRONTEND=noninteractive eatmydata \
apt-get install -y --no-install-recommends \
bison \
build-essential \

View file

@ -7,7 +7,8 @@
#
FROM qemu:debian-sid
RUN DEBIAN_FRONTEND=noninteractive eatmydata \
apt-get install -y --no-install-recommends \
RUN apt update && \
DEBIAN_FRONTEND=noninteractive eatmydata \
apt install -y --no-install-recommends \
gcc-powerpc-linux-gnu \
libc6-dev-powerpc-cross || { echo "Failed to build - see debian-sid.docker notes"; exit 1; }

View file

@ -5,7 +5,8 @@
# contains cross compilers for Debian "ports" targets.
FROM qemu:debian-sid
RUN DEBIAN_FRONTEND=noninteractive eatmydata \
apt-get install -y --no-install-recommends \
RUN apt update && \
DEBIAN_FRONTEND=noninteractive eatmydata \
apt install -y --no-install-recommends \
gcc-powerpc64-linux-gnu \
libc6-dev-ppc64-cross || { echo "Failed to build - see debian-sid.docker notes"; exit 1; }

View file

@ -7,18 +7,20 @@ FROM qemu:debian9
# Add the foreign architecture we want and install dependencies
RUN dpkg --add-architecture ppc64el && \
apt update
RUN apt install -yy crossbuild-essential-ppc64el
apt update && \
apt install -yy crossbuild-essential-ppc64el
RUN DEBIAN_FRONTEND=noninteractive eatmydata \
apt-get build-dep -yy -a ppc64el qemu
RUN apt update && \
DEBIAN_FRONTEND=noninteractive eatmydata \
apt build-dep -yy -a ppc64el qemu
# Specify the cross prefix for this image (see tests/docker/common.rc)
ENV QEMU_CONFIGURE_OPTS --cross-prefix=powerpc64le-linux-gnu-
# Install extra libraries to increase code coverage
RUN DEBIAN_FRONTEND=noninteractive eatmydata \
apt-get install -y --no-install-recommends \
RUN apt update && \
DEBIAN_FRONTEND=noninteractive eatmydata \
apt install -y --no-install-recommends \
libbz2-dev:ppc64el \
liblzo2-dev:ppc64el \
librdmacm-dev:ppc64el \

View file

@ -6,7 +6,8 @@
#
FROM qemu:debian-sid
RUN DEBIAN_FRONTEND=noninteractive eatmydata \
apt-get install -y --no-install-recommends \
RUN apt update && \
DEBIAN_FRONTEND=noninteractive eatmydata \
apt install -y --no-install-recommends \
gcc-riscv64-linux-gnu \
libc6-dev-riscv64-cross

View file

@ -10,19 +10,22 @@ RUN dpkg --add-architecture s390x
# Grab the updated list of packages
RUN apt update && apt dist-upgrade -yy
RUN DEBIAN_FRONTEND=noninteractive eatmydata \
apt-get install -y --no-install-recommends \
RUN apt update && \
DEBIAN_FRONTEND=noninteractive eatmydata \
apt install -y --no-install-recommends \
gcc-multilib-s390x-linux-gnu
RUN DEBIAN_FRONTEND=noninteractive eatmydata \
apt-get build-dep -yy -a s390x qemu
RUN apt update && \
DEBIAN_FRONTEND=noninteractive eatmydata \
apt build-dep -yy -a s390x qemu
# Specify the cross prefix for this image (see tests/docker/common.rc)
ENV QEMU_CONFIGURE_OPTS --cross-prefix=s390x-linux-gnu-
# Install extra libraries to increase code coverage
RUN DEBIAN_FRONTEND=noninteractive eatmydata \
apt-get install -y --no-install-recommends \
RUN apt update && \
DEBIAN_FRONTEND=noninteractive eatmydata \
apt install -y --no-install-recommends \
libbz2-dev:s390x \
liblzo2-dev:s390x \
librdmacm-dev:s390x \

View file

@ -6,7 +6,8 @@
#
FROM qemu:debian-sid
RUN DEBIAN_FRONTEND=noninteractive eatmydata \
apt-get install -y --no-install-recommends \
RUN apt update && \
DEBIAN_FRONTEND=noninteractive eatmydata \
apt install -y --no-install-recommends \
gcc-sh4-linux-gnu \
libc6-dev-sh4-cross

View file

@ -26,9 +26,9 @@ RUN sed -i "s%^deb \(https\?://\)deb.debian.org/debian/\? \(.*\)%deb [check-vali
RUN cat /etc/apt/sources.list | sed "s/^deb\ /deb-src /" >> /etc/apt/sources.list
# Install common build utilities
RUN apt update
RUN DEBIAN_FRONTEND=noninteractive apt install -yy eatmydata
RUN DEBIAN_FRONTEND=noninteractive eatmydata \
RUN apt update && \
DEBIAN_FRONTEND=noninteractive apt install -yy eatmydata && \
DEBIAN_FRONTEND=noninteractive eatmydata \
apt install -y --no-install-recommends \
bison \
build-essential \

View file

@ -6,7 +6,8 @@
#
FROM qemu:debian-sid
RUN DEBIAN_FRONTEND=noninteractive eatmydata \
apt-get install -y --no-install-recommends \
RUN apt update && \
DEBIAN_FRONTEND=noninteractive eatmydata \
apt install -y --no-install-recommends \
gcc-sparc64-linux-gnu \
libc6-dev-sparc64-cross

View file

@ -14,7 +14,8 @@ ENV PATH $PATH:/usr/lib/mxe/usr/$TARGET-w64-mingw32.shared/bin
ENV PKG_CONFIG_PATH \
$PKG_CONFIG_PATH:/usr/lib/mxe/usr/$TARGET-w64-mingw32.shared/lib/pkgconfig
RUN DEBIAN_FRONTEND=noninteractive eatmydata \
RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive eatmydata \
apt-get install -y --no-install-recommends \
mxe-$TARGET-w64-mingw32.shared-bzip2 \
mxe-$TARGET-w64-mingw32.shared-curl \

View file

@ -14,7 +14,8 @@ ENV PATH $PATH:/usr/lib/mxe/usr/$TARGET-w64-mingw32.shared/bin
ENV PKG_CONFIG_PATH \
$PKG_CONFIG_PATH:/usr/lib/mxe/usr/$TARGET-w64-mingw32.shared/lib/pkgconfig
RUN DEBIAN_FRONTEND=noninteractive eatmydata \
RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive eatmydata \
apt-get install -y --no-install-recommends \
mxe-$TARGET-w64-mingw32.shared-bzip2 \
mxe-$TARGET-w64-mingw32.shared-curl \

View file

@ -8,8 +8,8 @@
FROM debian:stretch-slim
RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive apt install -yy eatmydata
RUN DEBIAN_FRONTEND=noninteractive eatmydata \
DEBIAN_FRONTEND=noninteractive apt install -yy eatmydata && \
DEBIAN_FRONTEND=noninteractive eatmydata \
apt-get install -y --no-install-recommends \
bison \
build-essential \

View file

@ -13,9 +13,9 @@ FROM debian:buster-slim
RUN cat /etc/apt/sources.list | sed "s/^deb\ /deb-src /" >> /etc/apt/sources.list
# Install common build utilities
RUN apt update
RUN DEBIAN_FRONTEND=noninteractive apt install -yy eatmydata
RUN DEBIAN_FRONTEND=noninteractive eatmydata \
RUN apt update && \
DEBIAN_FRONTEND=noninteractive apt install -yy eatmydata && \
DEBIAN_FRONTEND=noninteractive eatmydata \
apt install -y --no-install-recommends \
bison \
build-essential \

View file

@ -15,9 +15,9 @@ MAINTAINER Philippe Mathieu-Daudé <f4bug@amsat.org>
RUN cat /etc/apt/sources.list | sed "s/^deb\ /deb-src /" >> /etc/apt/sources.list
# Setup some basic tools we need
RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive apt install -yy eatmydata
RUN DEBIAN_FRONTEND=noninteractive eatmydata \
RUN apt update && \
DEBIAN_FRONTEND=noninteractive apt-get install -yy eatmydata && \
DEBIAN_FRONTEND=noninteractive eatmydata \
apt-get install -y --no-install-recommends \
bison \
binutils-multiarch \

View file

@ -13,8 +13,8 @@ RUN DEBIAN_FRONTEND=noninteractive eatmydata \
# Add the foreign architecture we want and install dependencies
RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys C6BF758A33A3A276 && \
echo "deb http://pkg.mxe.cc/repos/apt stretch main" > /etc/apt/sources.list.d/mxeapt.list
RUN apt-get update
RUN DEBIAN_FRONTEND=noninteractive eatmydata \
RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive eatmydata \
apt-get install -y --no-install-recommends \
libpython2.7-stdlib \
$(apt-get -s install -y --no-install-recommends gw32.shared-mingw-w64 | egrep "^Inst mxe-x86-64-unknown-" | cut -d\ -f2)

View file

@ -13,9 +13,9 @@ FROM debian:stretch-slim
RUN cat /etc/apt/sources.list | sed "s/^deb\ /deb-src /" >> /etc/apt/sources.list
# Install common build utilities
RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive apt install -yy eatmydata
RUN DEBIAN_FRONTEND=noninteractive eatmydata \
RUN apt update && \
DEBIAN_FRONTEND=noninteractive apt install -yy eatmydata && \
DEBIAN_FRONTEND=noninteractive eatmydata \
apt install -y --no-install-recommends \
bison \
build-essential \