Commit 253dbea22107e19f9a598b746d9341a660d7ddb8

Patrick Steinhardt 2019-08-02T10:21:32

docker: install mbedTLS on both Bionic and Xenial We're about to phase out support for Trusty, but neither Bionic nor Xenial images provide the mbedTLS library that's available in Trusty. Build them for both to pull them in line with Trusty.

diff --git a/azure-pipelines/docker/bionic b/azure-pipelines/docker/bionic
index 7cd906b..868d731 100644
--- a/azure-pipelines/docker/bionic
+++ b/azure-pipelines/docker/bionic
@@ -5,3 +5,15 @@ 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 mkdir /var/run/sshd
+
+RUN cd /tmp && \
+    curl -LO https://tls.mbed.org/download/mbedtls-2.16.2-apache.tgz && \
+    tar -xf mbedtls-2.16.2-apache.tgz && \
+    rm -f mbedtls-2.16.2-apache.tgz && \
+    cd mbedtls-2.16.2 && \
+    scripts/config.pl set MBEDTLS_MD4_C 1 && \
+    CFLAGS=-fPIC cmake -DENABLE_PROGRAMS=OFF -DENABLE_TESTING=OFF -DUSE_SHARED_MBEDTLS_LIBRARY=OFF -DUSE_STATIC_MBEDTLS_LIBRARY=ON . && \
+    cmake --build . && \
+    make install && \
+    cd .. && \
+    rm -rf mbedtls-2.16.2
diff --git a/azure-pipelines/docker/xenial b/azure-pipelines/docker/xenial
index f82f272..f50854b 100644
--- a/azure-pipelines/docker/xenial
+++ b/azure-pipelines/docker/xenial
@@ -4,3 +4,15 @@ 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 mkdir /var/run/sshd
+
+RUN cd /tmp && \
+    curl -LO https://tls.mbed.org/download/mbedtls-2.16.2-apache.tgz && \
+    tar -xf mbedtls-2.16.2-apache.tgz && \
+    rm -f mbedtls-2.16.2-apache.tgz && \
+    cd mbedtls-2.16.2 && \
+    scripts/config.pl set MBEDTLS_MD4_C 1 && \
+    CFLAGS=-fPIC cmake -DENABLE_PROGRAMS=OFF -DENABLE_TESTING=OFF -DUSE_SHARED_MBEDTLS_LIBRARY=OFF -DUSE_STATIC_MBEDTLS_LIBRARY=ON . && \
+    cmake --build . && \
+    make install && \
+    cd .. && \
+    rm -rf mbedtls-2.16.2