aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/Dockerfile
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/Dockerfile')
-rw-r--r--scripts/Dockerfile23
1 files changed, 14 insertions, 9 deletions
diff --git a/scripts/Dockerfile b/scripts/Dockerfile
index 654a9f29..dd373d2a 100644
--- a/scripts/Dockerfile
+++ b/scripts/Dockerfile
@@ -1,18 +1,23 @@
-FROM alpine
+FROM alpine AS build
MAINTAINER chriseth <chris@ethereum.org>
#Official solidity docker image
#Establish working directory as solidity
WORKDIR /solidity
+
+# Build dependencies
+ADD /scripts/install_deps.sh /solidity/scripts/install_deps.sh
+RUN ./scripts/install_deps.sh
+
#Copy working directory on travis to the image
COPY / $WORKDIR
-#Install dependencies, eliminate annoying warnings, and build release, delete all remaining points and statically link.
-RUN ./scripts/install_deps.sh && sed -i -E -e 's/include <sys\/poll.h>/include <poll.h>/' /usr/include/boost/asio/detail/socket_types.hpp &&\
-cmake -DCMAKE_BUILD_TYPE=Release -DTESTS=0 -DSOLC_LINK_STATIC=1 &&\
-make solc && install -s solc/solc /usr/bin &&\
-cd / && rm -rf solidity &&\
-apk del sed build-base git make cmake gcc g++ musl-dev curl-dev boost-dev &&\
-rm -rf /var/cache/apk/*
+#Install dependencies, eliminate annoying warnings
+RUN sed -i -E -e 's/include <sys\/poll.h>/include <poll.h>/' /usr/include/boost/asio/detail/socket_types.hpp
+RUN cmake -DCMAKE_BUILD_TYPE=Release -DTESTS=0 -DSOLC_LINK_STATIC=1
+RUN make solc -j$(grep -c ^processor /proc/cpuinfo) && install -s solc/solc /usr/bin
+#RUN strip solc/solc
-ENTRYPOINT ["/usr/bin/solc"] \ No newline at end of file
+FROM scratch
+COPY --from=build /solidity/solc/solc /usr/bin/solc
+ENTRYPOINT ["/usr/bin/solc"]