Skip to content

Commit 39b7e8b

Browse files
committed
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 parent 9f91d57 commit 39b7e8b

File tree

2 files changed

+35
-7
lines changed

2 files changed

+35
-7
lines changed

azure-pipelines/docker/bionic

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,23 @@
11
ARG BASE
22
FROM $BASE
3-
ARG CACHEBUST=1
4-
RUN apt-get update
5-
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
6-
RUN if [ "$ARCH" != "armhf" -a "$ARCH" != "arm64" ]; then apt-get -y install openjdk-11-jre-headless; fi
3+
RUN apt-get update && \
4+
apt-get install -y \
5+
clang \
6+
cmake \
7+
curl \
8+
git \
9+
libcurl4 \
10+
libcurl4-openssl-dev \
11+
libssh2-1-dev \
12+
libssl-dev \
13+
libz-dev \
14+
openjdk-11-jre-headless \
15+
openssh-client \
16+
openssh-server \
17+
pkgconf \
18+
valgrind \
19+
&& \
20+
rm -rf /var/lib/apt/lists/*
721
RUN mkdir /var/run/sshd
822

923
RUN cd /tmp && \

azure-pipelines/docker/xenial

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,22 @@
11
ARG BASE
22
FROM $BASE
3-
ARG CACHEBUST=1
4-
RUN apt-get update
5-
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
3+
RUN apt-get update && \
4+
apt-get install -y \
5+
clang \
6+
cmake \
7+
curl \
8+
git \
9+
libcurl3 \
10+
libcurl3-gnutls \
11+
libcurl4-gnutls-dev \
12+
libssl-dev \
13+
openjdk-8-jre \
14+
openssh-client \
15+
openssh-server \
16+
pkgconf \
17+
valgrind \
18+
&& \
19+
rm -rf /var/lib/apt/lists/*
620
RUN mkdir /var/run/sshd
721

822
RUN cd /tmp && \

0 commit comments

Comments
 (0)