docker: convert apt-get to use best practices Reformat both Xenial and Bionic's Dockerfiles to use best practices. Most importantly, we now run `apt-get update` and `apt-get install` in one step followed up by removing the package lists to speed up installation and keep down the image size.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62
diff --git a/azure-pipelines/docker/bionic b/azure-pipelines/docker/bionic
index 868d731..7980b8e 100644
--- a/azure-pipelines/docker/bionic
+++ b/azure-pipelines/docker/bionic
@@ -1,9 +1,23 @@
ARG BASE
FROM $BASE
-ARG CACHEBUST=1
-RUN apt-get update
-RUN apt-get -y install pkgconf clang git cmake curl libssl-dev libcurl4 libcurl4-openssl-dev libssh2-1-dev libz-dev valgrind openssh-client openssh-server
-RUN if [ "$ARCH" != "armhf" -a "$ARCH" != "arm64" ]; then apt-get -y install openjdk-11-jre-headless; fi
+RUN apt-get update && \
+ apt-get install -y \
+ clang \
+ cmake \
+ curl \
+ git \
+ libcurl4 \
+ libcurl4-openssl-dev \
+ libssh2-1-dev \
+ libssl-dev \
+ libz-dev \
+ openjdk-11-jre-headless \
+ openssh-client \
+ openssh-server \
+ pkgconf \
+ valgrind \
+ && \
+ rm -rf /var/lib/apt/lists/*
RUN mkdir /var/run/sshd
RUN cd /tmp && \
diff --git a/azure-pipelines/docker/xenial b/azure-pipelines/docker/xenial
index 847e201..9326799 100644
--- a/azure-pipelines/docker/xenial
+++ b/azure-pipelines/docker/xenial
@@ -1,8 +1,22 @@
ARG BASE
FROM $BASE
-ARG CACHEBUST=1
-RUN apt-get update
-RUN apt-get -y install pkgconf clang git cmake curl libssl-dev libcurl3 libcurl3-gnutls libcurl4-gnutls-dev valgrind openssh-client openssh-server openjdk-8-jre
+RUN apt-get update && \
+ apt-get install -y \
+ clang \
+ cmake \
+ curl \
+ git \
+ libcurl3 \
+ libcurl3-gnutls \
+ libcurl4-gnutls-dev \
+ libssl-dev \
+ openjdk-8-jre \
+ openssh-client \
+ openssh-server \
+ pkgconf \
+ valgrind \
+ && \
+ rm -rf /var/lib/apt/lists/*
RUN mkdir /var/run/sshd
RUN cd /tmp && \