summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEdward Thomson <ethomson@edwardthomson.com>2019-11-23 12:40:02 +1100
committerEdward Thomson <ethomson@edwardthomson.com>2019-11-24 16:49:35 +1100
commit848078849276c2d8e9d1ab6e10c7d413ae53a521 (patch)
treebedd46c7847e749e9f937294aab9831220ce182c
parent7a3d04dc62ab582c569eb63106d54d03b308f39e (diff)
downloadlibgit2-848078849276c2d8e9d1ab6e10c7d413ae53a521.tar.gz
ci: break dockerfile into stages
Use a multi-stage docker build so that we can cache early stages and not need to download the apt-provided dependencies during every build (when only later stages change).
-rw-r--r--azure-pipelines/docker/xenial7
1 files changed, 5 insertions, 2 deletions
diff --git a/azure-pipelines/docker/xenial b/azure-pipelines/docker/xenial
index 108f5dee9..55aaed96e 100644
--- a/azure-pipelines/docker/xenial
+++ b/azure-pipelines/docker/xenial
@@ -1,5 +1,5 @@
ARG BASE
-FROM $BASE
+FROM $BASE AS apt
RUN echo 'deb http://ppa.launchpad.net/hola-launchpad/valgrind/ubuntu xenial main' >/etc/apt/sources.list.d/valgrind.list && \
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 8A0303A7544D59A08EBD1D621BCFD9273D292CF6 && \
apt-get update && \
@@ -22,8 +22,8 @@ RUN echo 'deb http://ppa.launchpad.net/hola-launchpad/valgrind/ubuntu xenial mai
pkgconf \
python \
valgrind
-RUN mkdir /var/run/sshd
+FROM apt AS mbedtls
RUN cd /tmp && \
curl -LO https://tls.mbed.org/download/mbedtls-2.16.2-apache.tgz && \
tar -xf mbedtls-2.16.2-apache.tgz && \
@@ -35,6 +35,7 @@ RUN cd /tmp && \
cd .. && \
rm -rf mbedtls-2.16.2
+FROM mbedtls AS libssh2
RUN cd /tmp && \
curl -LO https://www.libssh2.org/download/libssh2-1.8.2.tar.gz && \
tar -xf libssh2-1.8.2.tar.gz && \
@@ -45,7 +46,9 @@ RUN cd /tmp && \
cd .. && \
rm -rf libssh2-1.8.2
+FROM libssh2 AS configure
COPY entrypoint.sh /usr/local/bin/entrypoint.sh
RUN chmod a+x /usr/local/bin/entrypoint.sh
+RUN mkdir /var/run/sshd
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]