Use multi-stage docker builds

Decreases size and amount of layers.
This commit is contained in:
chriseth 2019-07-18 20:31:08 +02:00 committed by Mathias Baumann
parent 15cba9163e
commit b6c9d0f933

View File

@ -21,7 +21,7 @@
#
# (c) 2016-2019 solidity contributors.
#------------------------------------------------------------------------------
FROM buildpack-deps:disco
FROM buildpack-deps:disco AS base
ARG DEBIAN_FRONTEND=noninteractive
@ -41,6 +41,8 @@ RUN set -ex; \
pip install codecov; \
rm -rf /var/lib/apt/lists/*
FROM base AS libraries
# Aleth for end-to-end tests
ARG ALETH_VERSION="1.6.0"
ARG ALETH_HASH="7f7004e1563299bc57882e32b32e4a195747dfb6"
@ -115,7 +117,7 @@ RUN set -ex; \
# EVMONE
RUN set -ex; \
cd /usr/src; \
git clone --branch="v0.1.0" --recurse-submodules https://github.com/chfast/evmone.git; \
git clone --branch="v0.1.0" --recurse-submodules https://github.com/ethereum/evmone.git; \
cd evmone; \
mkdir build; \
cd build; \
@ -124,3 +126,7 @@ RUN set -ex; \
ninja install/strip; \
rm -rf /usr/src/evmone
FROM base
COPY --from=libraries /usr/lib /usr/lib
COPY --from=libraries /usr/bin /usr/bin
COPY --from=libraries /usr/include /usr/include